From 4031178831029c11098e1b32d15e90e582582bc3 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 21 Nov 2025 10:36:31 -0800 Subject: [PATCH] Enhancement: treat 'error' as custom api field when mapped (#5999) --- src/widgets/customapi/component.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/customapi/component.jsx b/src/widgets/customapi/component.jsx index f537e8daa..2110e292a 100644 --- a/src/widgets/customapi/component.jsx +++ b/src/widgets/customapi/component.jsx @@ -166,7 +166,11 @@ export default function Component({ service }) { refreshInterval: Math.max(1000, refreshInterval), }); - if (customError) { + // if mappings includes an error field and the data contains an error field then show data even if there is an error + const mappingsIncludesError = Array.isArray(mappings) && mappings.find((mapping) => mapping.field === "error"); + const errorIsData = customData && typeof customData === "object" && "error" in customData; + + if (customError && !(mappingsIncludesError && errorIsData)) { return ; }