Skip to content

Commit

Permalink
implement integration types api on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesNg35 committed Jan 15, 2024
1 parent 9f5db19 commit cb9e76d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/api/integration/types/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export async function GET(req: Request) {
access_token
);

return $res(response);
return $res(response.data);
}
4 changes: 2 additions & 2 deletions apps/web/app/hooks/integrations/useIntegrationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
6 changes: 3 additions & 3 deletions apps/web/app/services/client/api/integrations/types.ts
Original file line number Diff line number Diff line change
@@ -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<CreateResponse<IIntegrationType[]>>(`/integration/types`);
return get<IIntegrationType[]>(`/integration/types`);
}

0 comments on commit cb9e76d

Please sign in to comment.