Skip to content

Commit

Permalink
changed if/else to a ternary expression
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-rite committed Sep 5, 2024
1 parent 12142c1 commit eae6f24
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions api/source/service/CollectionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,8 @@ exports.queryCollections = async function (inProjection = [], inPredicates = {},
) as "owners"`)
}
if (inProjection.includes('labels')) {
if ( inPredicates.collectionId ) {
// get labels for specified collectionId
queries.push(_this.getCollectionLabels(inPredicates.collectionId, userObject))
}
else {
// no collectionId specified, get "all" labels
queries.push(_this.getCollectionLabels('all', userObject))
}
// get labels for specified collectionId. If no collectionId specified, get "all" labels
queries.push(_this.getCollectionLabels(inPredicates.collectionId ? inPredicates.collectionId : 'all', userObject));
}
if (inProjection.includes('statistics')) {
if (context == dbUtils.CONTEXT_USER) {
Expand Down

0 comments on commit eae6f24

Please sign in to comment.