From ae293623945367f7bb0a3f6a1fea429931cbe9e3 Mon Sep 17 00:00:00 2001 From: Rachid Flih Date: Thu, 1 Aug 2024 20:09:00 +0100 Subject: [PATCH] fix: REST Frontend Routes --- apps/webapp/src/hooks/create/useCreateApiKey.tsx | 2 +- apps/webapp/src/hooks/create/useCreateLinkedUser.tsx | 2 +- apps/webapp/src/hooks/create/useCreateMagicLink.tsx | 2 +- apps/webapp/src/hooks/create/useRefreshAccessToken.tsx | 2 +- apps/webapp/src/hooks/get/useApiKeys.tsx | 2 +- apps/webapp/src/hooks/get/useFieldMappings.tsx | 2 +- apps/webapp/src/hooks/get/useLinkedUsers.tsx | 2 +- apps/webapp/src/hooks/get/useProviderProperties.tsx | 2 +- apps/webapp/src/hooks/get/useWebhooks.tsx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/webapp/src/hooks/create/useCreateApiKey.tsx b/apps/webapp/src/hooks/create/useCreateApiKey.tsx index bdd0667ec..d8dcf2a3c 100644 --- a/apps/webapp/src/hooks/create/useCreateApiKey.tsx +++ b/apps/webapp/src/hooks/create/useCreateApiKey.tsx @@ -11,7 +11,7 @@ export interface IApiKeyDto { // Adjusted useCreateApiKey hook to include a promise-returning function const useCreateApiKey = () => { const addApiKey = async (data: IApiKeyDto) => { - const response = await fetch(`${config.API_URL}/auth/generate-apikey`, { + const response = await fetch(`${config.API_URL}/auth/api_keys`, { method: 'POST', body: JSON.stringify(data), headers: { diff --git a/apps/webapp/src/hooks/create/useCreateLinkedUser.tsx b/apps/webapp/src/hooks/create/useCreateLinkedUser.tsx index e7c18aa76..6d40b1764 100644 --- a/apps/webapp/src/hooks/create/useCreateLinkedUser.tsx +++ b/apps/webapp/src/hooks/create/useCreateLinkedUser.tsx @@ -9,7 +9,7 @@ interface ILinkedUserDto { } const useCreateLinkedUser = () => { const add = async (linkedUserData: ILinkedUserDto) => { - const response = await fetch(`${config.API_URL}/linked-users/internal`, { + const response = await fetch(`${config.API_URL}/linked_users/internal`, { method: 'POST', body: JSON.stringify(linkedUserData), headers: { diff --git a/apps/webapp/src/hooks/create/useCreateMagicLink.tsx b/apps/webapp/src/hooks/create/useCreateMagicLink.tsx index 231e35bc5..238de6a16 100644 --- a/apps/webapp/src/hooks/create/useCreateMagicLink.tsx +++ b/apps/webapp/src/hooks/create/useCreateMagicLink.tsx @@ -11,7 +11,7 @@ interface ILinkDto { const useCreateMagicLink = () => { const add = async (data: ILinkDto) => { - const response = await fetch(`${config.API_URL}/magic-links`, { + const response = await fetch(`${config.API_URL}/magic_links`, { method: 'POST', body: JSON.stringify(data), headers: { diff --git a/apps/webapp/src/hooks/create/useRefreshAccessToken.tsx b/apps/webapp/src/hooks/create/useRefreshAccessToken.tsx index d5dbc6ce4..aba269076 100644 --- a/apps/webapp/src/hooks/create/useRefreshAccessToken.tsx +++ b/apps/webapp/src/hooks/create/useRefreshAccessToken.tsx @@ -8,7 +8,7 @@ interface IRefreshOutputDto { const useRefreshAccessToken = () => { const refreshAccessToken = async (projectId: string) => { - const response = await fetch(`${config.API_URL}/auth/refresh-token`, { + const response = await fetch(`${config.API_URL}/auth/refresh_tokens`, { method: 'POST', body: JSON.stringify({ projectId: projectId diff --git a/apps/webapp/src/hooks/get/useApiKeys.tsx b/apps/webapp/src/hooks/get/useApiKeys.tsx index cf211ff8e..a33d19d4e 100644 --- a/apps/webapp/src/hooks/get/useApiKeys.tsx +++ b/apps/webapp/src/hooks/get/useApiKeys.tsx @@ -7,7 +7,7 @@ const useApiKeys = () => { return useQuery({ queryKey: ['api-keys'], queryFn: async (): Promise => { - const response = await fetch(`${config.API_URL}/auth/api-keys`, + const response = await fetch(`${config.API_URL}/auth/api_keys`, { method: 'GET', headers: { diff --git a/apps/webapp/src/hooks/get/useFieldMappings.tsx b/apps/webapp/src/hooks/get/useFieldMappings.tsx index dcdc3e28a..7fa662fb8 100644 --- a/apps/webapp/src/hooks/get/useFieldMappings.tsx +++ b/apps/webapp/src/hooks/get/useFieldMappings.tsx @@ -7,7 +7,7 @@ const useFieldMappings = () => { return useQuery({ queryKey: ['mappings'], queryFn: async (): Promise => { - const response = await fetch(`${config.API_URL}/field-mappings/attribute`, + const response = await fetch(`${config.API_URL}/field_mappings/attributes`, { method: 'GET', headers: { diff --git a/apps/webapp/src/hooks/get/useLinkedUsers.tsx b/apps/webapp/src/hooks/get/useLinkedUsers.tsx index bf7181e78..2e46d2fc8 100644 --- a/apps/webapp/src/hooks/get/useLinkedUsers.tsx +++ b/apps/webapp/src/hooks/get/useLinkedUsers.tsx @@ -7,7 +7,7 @@ const useLinkedUsers = () => { return useQuery({ queryKey: ['linked-users'], queryFn: async (): Promise => { - const response = await fetch(`${config.API_URL}/linked-users/internal`, + const response = await fetch(`${config.API_URL}/linked_users/internal`, { method: 'GET', headers: { diff --git a/apps/webapp/src/hooks/get/useProviderProperties.tsx b/apps/webapp/src/hooks/get/useProviderProperties.tsx index d6c718ec8..422dc3b47 100644 --- a/apps/webapp/src/hooks/get/useProviderProperties.tsx +++ b/apps/webapp/src/hooks/get/useProviderProperties.tsx @@ -6,7 +6,7 @@ const useProviderProperties = (linkedUserId: string, providerId: string, vertica return useQuery({ queryKey: ['providerProperties', linkedUserId, providerId, vertical], queryFn: async () => { - const response = await fetch(`${config.API_URL}/field-mappings/properties?linkedUserId=${linkedUserId}&providerId=${providerId}&vertical=${vertical}`, + const response = await fetch(`${config.API_URL}/field_mappings/properties?linkedUserId=${linkedUserId}&providerId=${providerId}&vertical=${vertical}`, { method: 'GET', headers: { diff --git a/apps/webapp/src/hooks/get/useWebhooks.tsx b/apps/webapp/src/hooks/get/useWebhooks.tsx index a9c591c24..30d4671de 100644 --- a/apps/webapp/src/hooks/get/useWebhooks.tsx +++ b/apps/webapp/src/hooks/get/useWebhooks.tsx @@ -8,7 +8,7 @@ const useWebhooks = () => { queryKey: ['webhooks'], queryFn: async (): Promise => { console.log("Webhook mutation called") - const response = await fetch(`${config.API_URL}/webhook/internal`, + const response = await fetch(`${config.API_URL}/webhooks/internal`, { method: 'GET', headers: {