Skip to content

Fix up the sortBy parameter - (Top 2364) #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove self-service check since that is affecting Phoenix challenges
  • Loading branch information
jmgasper committed Jul 29, 2024
commit 7040bb68253e0ffb93c1a8e94dacd2641d950a8a
83 changes: 0 additions & 83 deletions src/services/ChallengeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ async function searchChallenges(currentUser, criteria) {

const _hasAdminRole = hasAdminRole(currentUser);

const includeSelfService =
currentUser &&
(currentUser.isMachine ||
_hasAdminRole ||
_.includes(config.SELF_SERVICE_WHITELIST_HANDLES, currentUser.handle.toLowerCase()));

const includedTrackIds = _.isArray(criteria.trackIds) ? criteria.trackIds : [];
const includedTypeIds = _.isArray(criteria.typeIds) ? criteria.typeIds : [];

Expand Down Expand Up @@ -647,83 +641,6 @@ async function searchChallenges(currentUser, criteria) {
});
}

if (!includeSelfService) {
mustQuery.push({
bool: {
should: [
{ bool: { must_not: { exists: { field: "legacy.selfService" } } } },
...(currentUser
? [
{
bool: {
must: [
{
bool: {
must_not: {
match_phrase: {
status: constants.challengeStatuses.New,
},
},
},
},
{
bool: {
must_not: {
match_phrase: {
status: constants.challengeStatuses.Draft,
},
},
},
},
{
bool: {
must_not: {
match_phrase: {
status: constants.challengeStatuses.Approved,
},
},
},
},
],
},
},
{
bool: {
must: { match_phrase: { createdBy: currentUser.handle } },
},
},
]
: [
{
bool: {
should: [
{
bool: {
must: {
match_phrase: {
status: constants.challengeStatuses.Active,
},
},
},
},
{
bool: {
must: {
match_phrase: {
status: constants.challengeStatuses.Completed,
},
},
},
},
],
},
},
]),
],
},
});
}

if (groupsQuery.length > 0) {
mustQuery.push({
bool: {
Expand Down