Skip to content

Commit

Permalink
feat: wrap findMwlItems in mwl item model
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Jan 19, 2024
1 parent b519dd3 commit 094b637
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class ChangeFilteredMwlItemStatusService extends BaseQueryService {
}

async getMwlItems() {
let query = (await convertRequestQueryToMongoQuery(this.query)).$match;
return await MwlItemModel.find(query);
return await MwlItemModel.findMwlItems(this.query);
}
}

Expand Down
4 changes: 4 additions & 0 deletions models/mongodb/models/mwlitems.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ let mwlItemSchema = new mongoose.Schema(
...generalDicomJson
});
return await mwlItem.save();
},
findMwlItems: async function(query) {
let mongoQuery = await convertRequestQueryToMongoQuery(query);
return await mongoose.model("mwlItems").find(mongoQuery);
}
},
methods: {
Expand Down

0 comments on commit 094b637

Please sign in to comment.