Skip to content

Commit

Permalink
fix: fix faulty conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Sep 29, 2022
1 parent c7ff6f7 commit 46fed10
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/controllers/units.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,21 @@ export const findAll = async (req, res) => {
};
}

if (hasMarketplaceIdentifier) {
if (
typeof hasMarketplaceIdentifier === 'boolean' &&
hasMarketplaceIdentifier === true
) {
if (!where) {
where = {};
}

where.marketplaceIdentifier = {
[Sequelize.Op.not]: null,
};
} else {
} else if (
typeof hasMarketplaceIdentifier === 'boolean' &&
hasMarketplaceIdentifier === false
) {
if (!where) {
where = {};
}
Expand Down

0 comments on commit 46fed10

Please sign in to comment.