From 5f98b1ba0746acfeeb1b430ab892890ed4de34a3 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 7 Mar 2024 16:56:20 +0000 Subject: [PATCH] fix(audit): use correct endpoint for retrieve (#3578) --- frontend/common/services/useAuditLogItem.ts | 2 +- frontend/common/types/requests.ts | 5 ++++- frontend/web/components/pages/AuditLogItemPage.tsx | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/common/services/useAuditLogItem.ts b/frontend/common/services/useAuditLogItem.ts index a0c63a110874..924e2a7f7b9a 100644 --- a/frontend/common/services/useAuditLogItem.ts +++ b/frontend/common/services/useAuditLogItem.ts @@ -12,7 +12,7 @@ export const auditLogItemService = service >({ providesTags: (res) => [{ id: res?.id, type: 'AuditLogItem' }], query: (query: Req['getAuditLogItem']) => ({ - url: `audit/${query.id}/`, + url: `projects/${query.projectId}/audit/${query.id}/`, }), }), // END OF ENDPOINTS diff --git a/frontend/common/types/requests.ts b/frontend/common/types/requests.ts index 2f7937b16d29..ffff385c578a 100644 --- a/frontend/common/types/requests.ts +++ b/frontend/common/types/requests.ts @@ -246,7 +246,10 @@ export type Req = { environmentId: string data: { name: string } } - getAuditLogItem: { id: string } + getAuditLogItem: { + projectId: string + id: string + } getProject: { id: string } // END OF TYPES } diff --git a/frontend/web/components/pages/AuditLogItemPage.tsx b/frontend/web/components/pages/AuditLogItemPage.tsx index 3a1e1d740c1e..dc39a0321b2a 100644 --- a/frontend/web/components/pages/AuditLogItemPage.tsx +++ b/frontend/web/components/pages/AuditLogItemPage.tsx @@ -25,6 +25,7 @@ type AuditLogItemPageType = { const AuditLogItemPage: FC = ({ match }) => { const { data, error, isLoading } = useGetAuditLogItemQuery({ id: match.params.id, + projectId: match.params.projectId }) const index = (ProjectStore.getEnvs() as Environment[] | null)?.findIndex(