Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 9309663

Browse files
committed
Revert "SUP-605 show challenges where name includes technology"
1 parent 7c04ce2 commit 9309663

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

actions/challenges.js

+4-16
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ var QUERY_PATH = './queries/';
125125
*/
126126
var TECHNOLOGY_FILTER = ' AND EXISTS (SELECT DISTINCT 1 FROM comp_technology ct WHERE ct.comp_vers_id = pi1.value ' +
127127
'AND ct.technology_type_id IN (@filter@))';
128-
129-
var EXT_TECHNOLOGY_FILTER = ' AND (pn.value LIKE ("%@tech@%") OR EXISTS (SELECT DISTINCT 1 FROM comp_technology ct WHERE ct.comp_vers_id = pi1.value ' +
130-
'AND ct.technology_type_id IN (@filter@)))';
128+
131129
/**
132130
* The platform filter for challenges api.
133131
* @since 1.23
@@ -747,15 +745,14 @@ function transferResultV2(src, helper) {
747745
* @param {String} content - the content that need in template.
748746
* @since 1.23
749747
*/
750-
var editSql = function (sql, template, content, tech) {
748+
var editSql = function (sql, template, content) {
751749
// For empty sql just return it.
752750
if (sql.length === 0) {
753751
return sql;
754752
}
755753
var index = sql.toLowerCase().indexOf('order by');
756754
if (!_.isUndefined(template)) {
757755
template = template.replace('@filter@', content);
758-
template = template.replace('@tech@', tech);
759756
}
760757
return sql.slice(0, index) + template + sql.slice(index, sql.length);
761758
};
@@ -779,13 +776,8 @@ var addFilter = function (sql, filter, isMyChallenges, helper, caller) {
779776

780777
if (_.isDefined(filter.technologies)) {
781778
technology = filter.technologies.join(', ');
782-
if (filter.tech) {
783-
sql.count = editSql(sql.count, EXT_TECHNOLOGY_FILTER, technology, filter.tech);
784-
sql.data = editSql(sql.data, EXT_TECHNOLOGY_FILTER, technology, filter.tech);
785-
} else {
786-
sql.count = editSql(sql.count, TECHNOLOGY_FILTER, technology);
787-
sql.data = editSql(sql.data, TECHNOLOGY_FILTER, technology);
788-
}
779+
sql.count = editSql(sql.count, TECHNOLOGY_FILTER, technology);
780+
sql.data = editSql(sql.data, TECHNOLOGY_FILTER, technology);
789781
}
790782

791783
if (_.isDefined(filter.challengeType)) {
@@ -3716,10 +3708,6 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) {
37163708
},
37173709
function (cb) {
37183710
validateInputParameterV2(helper, caller, type, query, filter, pageIndex, pageSize, sortColumn, sortOrder, listType, dbConnectionMap, cb);
3719-
3720-
if (filter.technologies) {
3721-
filter.tech = filter.technologies.split(',')[0];
3722-
}
37233711
}, function (cb) {
37243712
if (pageIndex === -1) {
37253713
pageIndex = 1;

0 commit comments

Comments
 (0)