From 4e2510c38b6e9e2c4f03de6807ed9ef5288ada66 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sat, 28 Mar 2026 21:46:54 +0100
Subject: [PATCH] fixed sys attributes
---
src/components/UnifiedDataBar/ChatsTab.tsx | 10 +++++++++-
src/components/UnifiedDataBar/FilesTab.tsx | 8 ++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/components/UnifiedDataBar/ChatsTab.tsx b/src/components/UnifiedDataBar/ChatsTab.tsx
index cfb961e..3260b61 100644
--- a/src/components/UnifiedDataBar/ChatsTab.tsx
+++ b/src/components/UnifiedDataBar/ChatsTab.tsx
@@ -75,7 +75,15 @@ const ChatsTab: React.FC = ({
`/api/workspace/${context.instanceId}/workflows`,
{ params: { includeArchived: true } },
);
- const workflows = response.data?.workflows || response.data?.data || [];
+ const body = response.data ?? {};
+ const nested = body.data && typeof body.data === 'object' && !Array.isArray(body.data)
+ ? (body.data as { workflows?: unknown })
+ : null;
+ const workflowsRaw =
+ body.workflows ??
+ nested?.workflows ??
+ (Array.isArray(body.data) ? body.data : null);
+ const workflows = Array.isArray(workflowsRaw) ? workflowsRaw : [];
const groupMap = new Map();
for (const wf of workflows) {
diff --git a/src/components/UnifiedDataBar/FilesTab.tsx b/src/components/UnifiedDataBar/FilesTab.tsx
index c96ebdd..a801560 100644
--- a/src/components/UnifiedDataBar/FilesTab.tsx
+++ b/src/components/UnifiedDataBar/FilesTab.tsx
@@ -51,9 +51,13 @@ const FilesTab: React.FC = ({ context, onFileSelect }) => {
setLoading(true);
try {
const response = await api.get(`/api/workspace/${context.instanceId}/files`);
- const data = response.data?.data || response.data || [];
+ const body = response.data;
+ const rawList =
+ (Array.isArray(body?.files) && body.files) ||
+ (Array.isArray(body?.data) && body.data) ||
+ (Array.isArray(body) ? body : []);
setFiles(
- data.map((f: any) => ({
+ rawList.map((f: any) => ({
id: f.id,
fileName: f.fileName || f.name || 'unknown',
mimeType: f.mimeType,