Skip to content

Commit

Permalink
Sección 17 - Clase 9 - Backend productos por plataformas
Browse files Browse the repository at this point in the history
  • Loading branch information
mugan86 committed Jun 11, 2020
1 parent 202e0fe commit 1fa0c6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/services/shop-product.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ class ShopProductsService extends ResolversOperationsService {
random: boolean = false,
otherFilters: object = {}
) {
console.log(platform);
let filter: object = { active: { $ne: false } };
if (active === ACTIVE_VALUES_FILTER.ALL) {
filter = {};
} else if (active === ACTIVE_VALUES_FILTER.INACTIVE) {
filter = { active: false };
}
if (platform !== ['-1'] && platform !== undefined) {
if (platform[0] !== '-1' && platform !== undefined) {
filter = {...filter, ...{platform_id: {$in: platform}}};
}

Expand Down

0 comments on commit 1fa0c6d

Please sign in to comment.