diff options
| -rw-r--r-- | frontend/src/store/flowStore.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/src/store/flowStore.ts b/frontend/src/store/flowStore.ts index 3d4930b..a919498 100644 --- a/frontend/src/store/flowStore.ts +++ b/frontend/src/store/flowStore.ts @@ -1523,7 +1523,7 @@ const useFlowStore = create<FlowState>((set, get) => { await jsonFetch(`${API_BASE}/api/projects/create_folder`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ user: DEFAULT_USER, path }), + body: JSON.stringify({ user: getCurrentUser(), path }), }); await get().refreshProjectTree(); }, @@ -1535,7 +1535,7 @@ const useFlowStore = create<FlowState>((set, get) => { await jsonFetch(`${API_BASE}/api/projects/rename`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ user: DEFAULT_USER, path, new_name: newName, new_path: newPath }), + body: JSON.stringify({ user: getCurrentUser(), path, new_name: newName, new_path: newPath }), }); await get().refreshProjectTree(); }, @@ -1544,7 +1544,7 @@ const useFlowStore = create<FlowState>((set, get) => { await jsonFetch(`${API_BASE}/api/projects/delete`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ user: DEFAULT_USER, path, is_folder: isFolder }), + body: JSON.stringify({ user: getCurrentUser(), path, is_folder: isFolder }), }); await get().refreshProjectTree(); }, @@ -1584,7 +1584,7 @@ const useFlowStore = create<FlowState>((set, get) => { }, saveArchivedNodes: async () => { - const payload = { user: DEFAULT_USER, archived: get().archivedNodes }; + const payload = { user: getCurrentUser(), archived: get().archivedNodes }; await jsonFetch(`${API_BASE}/api/projects/archived`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -1644,8 +1644,8 @@ const useFlowStore = create<FlowState>((set, get) => { addFileScope: async (fileId: string, scope: string) => { const res = await fetch(`${API_BASE}/api/files/add_scope`, { method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ user: DEFAULT_USER, file_id: fileId, scope }), + headers: { 'Content-Type': 'application/json', ...getAuthHeaders() }, + body: JSON.stringify({ user: getCurrentUser(), file_id: fileId, scope }), }); if (!res.ok) { throw new Error(await res.text()); @@ -1656,8 +1656,8 @@ const useFlowStore = create<FlowState>((set, get) => { removeFileScope: async (fileId: string, scope: string) => { const res = await fetch(`${API_BASE}/api/files/remove_scope`, { method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ user: DEFAULT_USER, file_id: fileId, scope }), + headers: { 'Content-Type': 'application/json', ...getAuthHeaders() }, + body: JSON.stringify({ user: getCurrentUser(), file_id: fileId, scope }), }); if (!res.ok) { throw new Error(await res.text()); |
