From e05d1b7ac12d3fb02e9e2aca23696ff0af21175d Mon Sep 17 00:00:00 2001 From: Abdelsalem Date: Thu, 20 Feb 2025 09:46:08 +0100 Subject: [PATCH] change api calls from directory to explore server Signed-off-by: Abdelsalem --- src/utils/rest-api.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/utils/rest-api.ts b/src/utils/rest-api.ts index 964eaa47..f9807a2a 100644 --- a/src/utils/rest-api.ts +++ b/src/utils/rest-api.ts @@ -32,7 +32,6 @@ import { UsersIdentities } from './user-identities.type'; const PREFIX_USER_ADMIN_SERVER_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/user-admin`; const PREFIX_CONFIG_NOTIFICATION_WS = `${import.meta.env.VITE_WS_GATEWAY}/config-notification`; const PREFIX_CONFIG_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/config`; -const PREFIX_DIRECTORY_SERVER_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/directory`; const PREFIX_EXPLORE_SERVER_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/explore`; const PREFIX_ACTIONS_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/actions`; const PREFIX_CASE_QUERIES = `${import.meta.env.VITE_API_GATEWAY}/case`; @@ -277,7 +276,7 @@ export function updateElement(elementUuid: UUID, element: unknown) { export function insertDirectory(directoryName: string, parentUuid: UUID, ownerId: string) { console.info("Inserting a new folder '%s'", directoryName); - const insertDirectoryUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${parentUuid}/elements`; + const insertDirectoryUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/${parentUuid}/directories`; return backendFetchJson(insertDirectoryUrl, { method: 'POST', headers: { @@ -295,7 +294,7 @@ export function insertDirectory(directoryName: string, parentUuid: UUID, ownerId export function insertRootDirectory(directoryName: string, ownerId: string) { console.info("Inserting a new root folder '%s'", directoryName); - const insertRootDirectoryUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories`; + const insertRootDirectoryUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/root-directories`; return backendFetchJson(insertRootDirectoryUrl, { method: 'POST', headers: { @@ -486,7 +485,7 @@ export function downloadSpreadsheetConfigCollection(collectionId: string) { export function elementExists(directoryUuid: UUID | null | undefined, elementName: string, type: string) { const elementNameEncoded = encodeURIComponent(elementName); - const existsElementUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements/${elementNameEncoded}/types/${type}`; + const existsElementUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/${directoryUuid}/elements/${elementNameEncoded}/types/${type}`; console.debug(existsElementUrl); return backendFetch(existsElementUrl, { method: 'head' }).then( (response) => response.status !== 204 // HTTP 204 : No-content @@ -494,7 +493,7 @@ export function elementExists(directoryUuid: UUID | null | undefined, elementNam } export function getNameCandidate(directoryUuid: UUID, elementName: string, type: string) { - const nameCandidateUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/${elementName}/newNameCandidate?type=${type}`; + const nameCandidateUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/${directoryUuid}/${elementName}/newNameCandidate?type=${type}`; console.debug(nameCandidateUrl); return backendFetchText(nameCandidateUrl, { method: 'GET', @@ -502,9 +501,9 @@ export function getNameCandidate(directoryUuid: UUID, elementName: string, type: } export function rootDirectoryExists(directoryName: string) { - const existsRootDirectoryUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories?${new URLSearchParams({ - directoryName, - }).toString()}`; + const existsRootDirectoryUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/root-directories?${new URLSearchParams( + { directoryName } + ).toString()}`; console.debug(existsRootDirectoryUrl); return backendFetch(existsRootDirectoryUrl, { method: 'head' }).then( (response) => response.status !== 204 // HTTP 204 : No-content