mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
refactor(web): use React Query for Google Drive folder operations
- Fix errors in connectors-api.service (use .issues instead of .errors) - Create useGoogleDriveFolders hook with proper React Query integration - Add Google Drive folders cache keys with proper query invalidation - Refactor GoogleDriveFolderTree to use React Query hook for root data - Remove manual state management (isInitialized, setRootItems, loadRootItems) - Remove unused state (driveFolders, isLoadingFolders) from manage page - Simplify handleOpenDriveFolderDialog function - Automatic loading, caching, error handling, and refetching via React Query - Better performance with proper caching and state management
This commit is contained in:
parent
c5c61a2c6b
commit
10c98745cd
6 changed files with 129 additions and 93 deletions
|
|
@ -67,5 +67,9 @@ export const cacheKeys = {
|
|||
["connectors", ...(queries ? Object.values(queries) : [])] as const,
|
||||
byId: (connectorId: string) => ["connector", connectorId] as const,
|
||||
index: () => ["connector", "index"] as const,
|
||||
googleDrive: {
|
||||
folders: (connectorId: number, parentId?: string) =>
|
||||
["connectors", "google-drive", connectorId, "folders", parentId] as const,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue