Skip to content

Commit

Permalink
fix getAllByConcept
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed May 3, 2024
1 parent 89abae0 commit 378de31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions models/Promotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ let Model = {
}
},
getAllByConcept(concept) {
if (concept.length < 1) {
sails.log.warn(`Promotion > getAllByConcept : [concept] array is unstable feature`, concept);
}
if (typeof concept === "string")
concept = [concept];
// if (concept.length < 1) {
// sails.log.warn(`Promotion > getAllByConcept : [concept] array is unstable feature`, concept)
// }
const promotionAdapter = adapters_1.Adapter.getPromotionAdapter();
if (!concept)
throw "concept is required";
Expand Down
7 changes: 4 additions & 3 deletions models/Promotion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,11 @@ let Model = {
},

getAllByConcept(concept: string[]): Promotion[] {
if(typeof concept === "string") concept = [concept];

if (concept.length < 1) {
sails.log.warn(`Promotion > getAllByConcept : [concept] array is unstable feature`, concept)
}
// if (concept.length < 1) {
// sails.log.warn(`Promotion > getAllByConcept : [concept] array is unstable feature`, concept)
// }

const promotionAdapter = Adapter.getPromotionAdapter()
if (!concept) throw "concept is required";
Expand Down

0 comments on commit 378de31

Please sign in to comment.