Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(backend:sync): use object instead of enum to check repository

johaven7eb3c872a1e0
diff --git a/backend/src/applications/sync/utils/routes.ts b/backend/src/applications/sync/utils/routes.ts
index b208bffd..95edf5f1 100644
--- a/backend/src/applications/sync/utils/routes.ts
+++ b/backend/src/applications/sync/utils/routes.ts
@@ -5,12 +5,12 @@
*/
import { PATH_TO_SPACE_SEGMENTS } from '../../spaces/utils/routes'
-import { SYNC_PATH_REPOSITORY, SYNC_REPOSITORY } from '../constants/sync'
+import { SYNC_PATH_REPOSITORY } from '../constants/sync'
export function SYNC_PATH_TO_SPACE_SEGMENTS(path: string): string[] {
const urlSegments = PATH_TO_SPACE_SEGMENTS(path)
const repository = urlSegments.shift()
- if (!(repository in SYNC_REPOSITORY)) {
+ if (!(repository in SYNC_PATH_REPOSITORY)) {
throw new Error(`Repository not found : ${repository}`)
}
urlSegments.unshift(...SYNC_PATH_REPOSITORY[repository])