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.
This commit is contained in:
Tom Butcher 2026-09-01 11:38:35 +01:00
parent 6e8ad1c412
commit 8ab44fc9da

View File

@ -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