From 8449030e3f4abb41d5c49bfe0265e060cc41cad0 Mon Sep 17 00:00:00 2001 From: Thorsten Zoerner Date: Wed, 7 Feb 2024 15:31:05 +0100 Subject: [PATCH] Fix: Usage of empty query in find operation should act same for in-memory and mongoDB. --- framework/services/asset.service.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/services/asset.service.js b/framework/services/asset.service.js index 2f3db9b..63f4293 100644 --- a/framework/services/asset.service.js +++ b/framework/services/asset.service.js @@ -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 {