From 5109279ebdc48ac8c9ff65884254ab450c366b13 Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Tue, 9 Jun 2026 23:40:43 +0200 Subject: [PATCH] fix: resolve TypeScript build errors Co-authored-by: Cursor --- .../nodes/frontendTypeRenderers/ClickUpListPicker.tsx | 2 +- src/hooks/useFiles.ts | 8 ++++---- src/hooks/useUsers.ts | 9 --------- src/hooks/useWorkflows.ts | 4 ++-- .../views/workflowAutomation/WorkflowTemplatesPage.tsx | 6 ++---- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/components/FlowEditor/nodes/frontendTypeRenderers/ClickUpListPicker.tsx b/src/components/FlowEditor/nodes/frontendTypeRenderers/ClickUpListPicker.tsx index 9d26c3d..5dfd2de 100644 --- a/src/components/FlowEditor/nodes/frontendTypeRenderers/ClickUpListPicker.tsx +++ b/src/components/FlowEditor/nodes/frontendTypeRenderers/ClickUpListPicker.tsx @@ -73,7 +73,7 @@ export const ClickUpListPicker: React.FC = ({ setLoading(true); setError(null); try { - const res = await fetchBrowse(request, instanceId, connectionReference, 'clickup', path); + const res = await fetchBrowse(request, connectionReference, 'clickup', path); setItems(res.items); setBrowsePath(res.path || path); } catch (err: unknown) { diff --git a/src/hooks/useFiles.ts b/src/hooks/useFiles.ts index 3755d6f..af71d57 100644 --- a/src/hooks/useFiles.ts +++ b/src/hooks/useFiles.ts @@ -134,10 +134,10 @@ export function useUserFiles() { console.error('Error fetching permissions:', error); const defaultPerms: UserPermissions = { view: true, - read: 'my', - create: 'my', - update: 'my', - delete: 'my', + read: 'o', + create: 'o', + update: 'o', + delete: 'o', }; setPermissions(defaultPerms); return defaultPerms; diff --git a/src/hooks/useUsers.ts b/src/hooks/useUsers.ts index e96e578..88d27d1 100644 --- a/src/hooks/useUsers.ts +++ b/src/hooks/useUsers.ts @@ -38,16 +38,7 @@ export function useCurrentUser() { } // JWT tokens are now stored in httpOnly cookies, so we fetch user data from API - - // Determine the correct endpoint based on authentication authority const authAuthority = sessionStorage.getItem('auth_authority'); - let endpoint = '/api/local/me'; - - if (authAuthority === 'msft') { - endpoint = '/api/msft/me'; - } else if (authAuthority === 'google') { - endpoint = '/api/google/me'; - } // Add a small delay to ensure cookies are properly set after authentication if (authAuthority === 'msft' || authAuthority === 'google') { diff --git a/src/hooks/useWorkflows.ts b/src/hooks/useWorkflows.ts index 1cae59c..2f1a11b 100644 --- a/src/hooks/useWorkflows.ts +++ b/src/hooks/useWorkflows.ts @@ -30,7 +30,7 @@ async function _deleteWorkflowsSequential( async function startWorkflowApi( request: ApiRequestFunction, - instanceId: string, + _instanceId: string, workflowData: StartWorkflowRequest, options?: { workflowId?: string; workflowMode?: 'Dynamic' | 'Automation' }, ) { @@ -106,7 +106,7 @@ export interface PaginationParams { } /** Get apiBaseUrl for workflow APIs (mandate-scoped) */ -export function getWorkflowApiBaseUrl(instanceId: string | undefined, featureCode: string | undefined): string | undefined { +export function getWorkflowApiBaseUrl(_instanceId: string | undefined, featureCode: string | undefined): string | undefined { if (!featureCode) return undefined; if (featureCode === 'workflowAutomation') return `/api/workflow-automation`; return undefined; diff --git a/src/pages/views/workflowAutomation/WorkflowTemplatesPage.tsx b/src/pages/views/workflowAutomation/WorkflowTemplatesPage.tsx index 3bae3c4..c7491d1 100644 --- a/src/pages/views/workflowAutomation/WorkflowTemplatesPage.tsx +++ b/src/pages/views/workflowAutomation/WorkflowTemplatesPage.tsx @@ -9,7 +9,7 @@ */ import React, { useState, useCallback, useEffect, useMemo } from 'react'; -import { useNavigate, useParams } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { FaCopy, FaSync, FaShareAlt, FaPen } from 'react-icons/fa'; import { usePrompt } from '../../../hooks/usePrompt'; import { FormGeneratorTable, type ColumnConfig } from '../../../components/FormGenerator'; @@ -53,7 +53,7 @@ interface WorkflowTemplatesPageProps { export const WorkflowTemplatesPage: React.FC = ({ persistentInstanceId, - persistentMandateId, + persistentMandateId: _persistentMandateId, }) => { const { t } = useLanguage(); @@ -68,9 +68,7 @@ export const WorkflowTemplatesPage: React.FC = ({ ); const urlInstanceId = useInstanceId(); - const { mandateId: urlMandateId } = useParams<{ mandateId: string }>(); const instanceId = persistentInstanceId || urlInstanceId; - const _mandateId = persistentMandateId || urlMandateId; const { request } = useApiRequest(); const navigate = useNavigate(); const { showSuccess, showError } = useToast();