Skip to content

Commit

Permalink
Fix: Usage of empty query in find operation should act same for in-me…
Browse files Browse the repository at this point in the history
…mory and mongoDB.
  • Loading branch information
zoernert committed Feb 7, 2024
1 parent acb4083 commit 8449030
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions framework/services/asset.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,14 @@ module.exports = {
async handler(ctx) {
if(db == null) {
let query = {"assetId" : ctx.params.q};
if((typeof ctx.params.q == 'undefined') || (ctx.params.q.length == 0)) {
query = {};
}
if(typeof ctx.params.type !== 'undefined') {
query.type = ctx.params.type;
}
// in case query is empty system should behave like mongoDB usage... (using list).

const assets = await ctx.call("asset_model.find",{query:query});
return assets;
} else {
Expand Down

0 comments on commit 8449030

Please sign in to comment.