diff --git a/src/components/Dashboard/context/ApiServerContext.jsx b/src/components/Dashboard/context/ApiServerContext.jsx index 8ddb068d..a457e8a5 100644 --- a/src/components/Dashboard/context/ApiServerContext.jsx +++ b/src/components/Dashboard/context/ApiServerContext.jsx @@ -1841,15 +1841,8 @@ const ApiServerProvider = ({ children }) => { const fetchTemplatePDF = async (id, content, testObject, callback) => { logger.debug('Fetching pdf template...') try { - const result = await fetchTemplateDownload( - id, - content, - testObject, - 'pdf' - ) - const payload = result.error - ? result - : { pdf: result.buffer || result } + const result = await fetchTemplateDownload(id, content, testObject, 'pdf') + const payload = result.error ? result : { pdf: result.buffer || result } if (typeof callback === 'function') { callback(payload) } @@ -2017,8 +2010,8 @@ const ApiServerProvider = ({ children }) => { if (!userProfile?._id) return { data: [] } const result = await fetchObjects('userNotifier', { filter: { - user: userProfile._id, - object: objectId, + 'user._id': userProfile._id, + 'object._id': objectId, objectType }, limit: 1 @@ -2029,7 +2022,7 @@ const ApiServerProvider = ({ children }) => { const fetchAllUserNotifiersForObject = async (objectId, objectType) => { const result = await fetchObjects('userNotifier', { filter: { - object: objectId, + 'object._id': objectId, objectType }, limit: 100