From c2c18e8319fb06d7649897a84ee701dbd2d2d644 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Tue, 2 Sep 2025 13:36:41 +0530 Subject: [PATCH] (feat:connector,fe) sync api, notification --- frontend/src/api/endpoints.ts | 1 + frontend/src/api/services/userService.ts | 12 ++++++++++++ frontend/src/components/ConnectorTreeComponent.tsx | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/endpoints.ts b/frontend/src/api/endpoints.ts index 81d19c87..955f43ee 100644 --- a/frontend/src/api/endpoints.ts +++ b/frontend/src/api/endpoints.ts @@ -38,6 +38,7 @@ const endpoints = { UPDATE_TOOL_STATUS: '/api/update_tool_status', UPDATE_TOOL: '/api/update_tool', DELETE_TOOL: '/api/delete_tool', + SYNC_CONNECTOR: '/api/connectors/sync', GET_CHUNKS: ( docId: string, page: number, diff --git a/frontend/src/api/services/userService.ts b/frontend/src/api/services/userService.ts index af5e4f22..7d365b3d 100644 --- a/frontend/src/api/services/userService.ts +++ b/frontend/src/api/services/userService.ts @@ -104,6 +104,18 @@ const userService = { apiClient.get(endpoints.USER.DIRECTORY_STRUCTURE(docId), token), manageSourceFiles: (data: FormData, token: string | null): Promise => apiClient.postFormData(endpoints.USER.MANAGE_SOURCE_FILES, data, token), + syncConnector: (docId: string, token: string | null): Promise => { + const sessionToken = localStorage.getItem('google_drive_session_token'); + return apiClient.post( + endpoints.USER.SYNC_CONNECTOR, + { + source_id: docId, + session_token: sessionToken, + provider: 'google_drive' + }, + token + ); + }, }; export default userService; diff --git a/frontend/src/components/ConnectorTreeComponent.tsx b/frontend/src/components/ConnectorTreeComponent.tsx index a4258dfc..96e235c6 100644 --- a/frontend/src/components/ConnectorTreeComponent.tsx +++ b/frontend/src/components/ConnectorTreeComponent.tsx @@ -171,7 +171,6 @@ const ConnectorTreeComponent: React.FC = ({ variant: 'primary', }); - // No delete option for connector files return options; };