From de72d1f5543b57b09928c39b17c155400b28ab4c Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Fri, 19 Jun 2026 21:39:32 +0100 Subject: [PATCH] Enhance ApiServerProvider to validate model name before processing filters. --- .../Dashboard/context/ApiServerContext.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Dashboard/context/ApiServerContext.jsx b/src/components/Dashboard/context/ApiServerContext.jsx index 0a31c07..dea2535 100644 --- a/src/components/Dashboard/context/ApiServerContext.jsx +++ b/src/components/Dashboard/context/ApiServerContext.jsx @@ -802,12 +802,14 @@ const ApiServerProvider = ({ children }) => { if (filter != null && Object.keys(filter).length > 0) { const model = getModelByName(type) - for (const key of Object.keys(filter)) { - const property = model?.properties?.find((p) => p.name === key) - if (property && property.type === 'object') { - const value = filter[key] - newFilter[`${key}._id`] = value?._id ?? value - delete newFilter[key] + if (model.name !== 'unknown') { + for (const key of Object.keys(filter)) { + const property = model?.properties?.find((p) => p.name === key) + if (property && property.type === 'object') { + const value = filter[key] + newFilter[`${key}._id`] = value?._id ?? value + delete newFilter[key] + } } } }