From 8ab44fc9da322dae0cad4f0b32a98c332ba7c407 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Tue, 1 Sep 2026 11:38:35 +0100 Subject: [PATCH] Refactor ApiServerContext to Simplify Filter Structure - Updated filter structure in fetchObjects calls within ApiServerProvider to remove unnecessary object notation, enhancing code clarity and maintainability. - Streamlined data fetching logic for user notifiers, improving overall performance and readability of the context component. --- src/components/Dashboard/context/ApiServerContext.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/context/ApiServerContext.jsx b/src/components/Dashboard/context/ApiServerContext.jsx index a201d052..b310cc46 100644 --- a/src/components/Dashboard/context/ApiServerContext.jsx +++ b/src/components/Dashboard/context/ApiServerContext.jsx @@ -2408,8 +2408,8 @@ const ApiServerProvider = ({ children }) => { if (!userProfile?._id) return { data: [] } const result = await fetchObjects('userNotifier', { filter: { - 'user._id': userProfile._id, - 'object._id': objectId, + user: userProfile._id, + object: objectId, objectType }, limit: 1 @@ -2420,7 +2420,7 @@ const ApiServerProvider = ({ children }) => { const fetchAllUserNotifiersForObject = async (objectId, objectType) => { const result = await fetchObjects('userNotifier', { filter: { - 'object._id': objectId, + object: objectId, objectType }, limit: 100