From cb9e76db886eff285a7e2f698f9e18bed4070a42 Mon Sep 17 00:00:00 2001 From: Paradoxe Ngwasi Date: Mon, 15 Jan 2024 14:07:36 +0000 Subject: [PATCH] implement integration types api on frontend --- apps/web/app/api/integration/types/route.ts | 2 +- apps/web/app/hooks/integrations/useIntegrationTypes.ts | 4 ++-- apps/web/app/services/client/api/integrations/types.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/app/api/integration/types/route.ts b/apps/web/app/api/integration/types/route.ts index dc7e8b44f..0fe710ca4 100644 --- a/apps/web/app/api/integration/types/route.ts +++ b/apps/web/app/api/integration/types/route.ts @@ -14,5 +14,5 @@ export async function GET(req: Request) { access_token ); - return $res(response); + return $res(response.data); } diff --git a/apps/web/app/hooks/integrations/useIntegrationTypes.ts b/apps/web/app/hooks/integrations/useIntegrationTypes.ts index 12253a1bb..55d005eb2 100644 --- a/apps/web/app/hooks/integrations/useIntegrationTypes.ts +++ b/apps/web/app/hooks/integrations/useIntegrationTypes.ts @@ -11,9 +11,9 @@ export function useIntegrationTypes() { const getIntegrationTypes = useCallback(() => { return queryCall().then((response) => { - setIntegrationTypes(response.data.data); + setIntegrationTypes(response.data); - return response.data.data; + return response.data; }); }, [queryCall, setIntegrationTypes]); diff --git a/apps/web/app/services/client/api/integrations/types.ts b/apps/web/app/services/client/api/integrations/types.ts index 5532b170c..041d1a735 100644 --- a/apps/web/app/services/client/api/integrations/types.ts +++ b/apps/web/app/services/client/api/integrations/types.ts @@ -1,6 +1,6 @@ -import { CreateResponse, IIntegrationType } from '@app/interfaces'; -import api from '../../axios'; +import { IIntegrationType } from '@app/interfaces'; +import { get } from '../../axios'; export function getIntegrationTypesAPI() { - return api.get>(`/integration/types`); + return get(`/integration/types`); }