(feat:connector) sync fixes UI, minor refactor

This commit is contained in:
ManishMadan2882
2025-09-02 20:28:23 +05:30
parent f9b2c95695
commit 3b3a04a249
5 changed files with 102 additions and 47 deletions

View File

@@ -1,5 +1,6 @@
import apiClient from '../client';
import endpoints from '../endpoints';
import { getSessionToken } from '../../utils/providerUtils';
const userService = {
getConfig: (): Promise<any> => apiClient.get(endpoints.USER.CONFIG, null),
@@ -104,14 +105,14 @@ const userService = {
apiClient.get(endpoints.USER.DIRECTORY_STRUCTURE(docId), token),
manageSourceFiles: (data: FormData, token: string | null): Promise<any> =>
apiClient.postFormData(endpoints.USER.MANAGE_SOURCE_FILES, data, token),
syncConnector: (docId: string, token: string | null): Promise<any> => {
const sessionToken = localStorage.getItem('google_drive_session_token');
syncConnector: (docId: string, provider: string, token: string | null): Promise<any> => {
const sessionToken = getSessionToken(provider);
return apiClient.post(
endpoints.USER.SYNC_CONNECTOR,
{
source_id: docId,
{
source_id: docId,
session_token: sessionToken,
provider: 'google_drive'
provider: provider
},
token
);