diff --git a/apps/studio/data/analytics/warehouse-collections-create-mutation.ts b/apps/studio/data/analytics/warehouse-collections-create-mutation.ts index d0bd683d996..cd52b553753 100644 --- a/apps/studio/data/analytics/warehouse-collections-create-mutation.ts +++ b/apps/studio/data/analytics/warehouse-collections-create-mutation.ts @@ -3,18 +3,18 @@ import { analyticsKeys } from './keys' import { post } from 'data/fetchers' async function createCollection(ref: string, payload: { name: string }) { - await post(`/platform/projects/{ref}/analytics/warehouse/tenant`, { - params: { - path: { ref }, - }, - }) + // await post(`/platform/projects/{ref}/analytics/warehouse/tenant`, { + // params: { + // path: { ref }, + // }, + // }) const res = await post(`/platform/projects/{ref}/analytics/warehouse/collections`, { params: { path: { ref }, }, body: payload, - }) + } as any) // TODO: Remove cast when openapi types get generated correctly return res } diff --git a/apps/studio/data/analytics/warehouse-collections-delete-mutation.ts b/apps/studio/data/analytics/warehouse-collections-delete-mutation.ts index 2f4f2d2193b..06bfe479992 100644 --- a/apps/studio/data/analytics/warehouse-collections-delete-mutation.ts +++ b/apps/studio/data/analytics/warehouse-collections-delete-mutation.ts @@ -15,10 +15,11 @@ export function useDeleteCollection({ const queryClient = useQueryClient() const mutation = useMutation({ mutationFn: async () => { - await del( - `/platform/projects/${projectRef}/analytics/warehouse/collections/${collectionToken}`, - {} - ) + await del(`/platform/projects/{ref}/analytics/warehouse/collections/{token}`, { + params: { + path: { ref: projectRef, token: collectionToken }, + } as any, // TODO: remove cast when openapi client generates correct types + }) const keysToInvalidate = analyticsKeys.warehouseCollections(projectRef) queryClient.invalidateQueries(keysToInvalidate) diff --git a/apps/studio/data/analytics/warehouse-collections-update-mutation.ts b/apps/studio/data/analytics/warehouse-collections-update-mutation.ts index 86f9f4f0efd..53b31fc9a7f 100644 --- a/apps/studio/data/analytics/warehouse-collections-update-mutation.ts +++ b/apps/studio/data/analytics/warehouse-collections-update-mutation.ts @@ -3,7 +3,7 @@ import { analyticsKeys } from './keys' import { patch } from 'data/fetchers' type UpdateCollectionArgs = { - projectRef: string, + projectRef: string collectionToken: string } type UpdateCollectionPayload = { @@ -14,11 +14,16 @@ export function useUpdateCollection({ projectRef, collectionToken }: UpdateColle const queryClient = useQueryClient() const mutation = useMutation({ mutationFn: async (payload: UpdateCollectionPayload) => { - const resp = await patch(`/platform/projects/${projectRef}/analytics/warehouse/collections/${collectionToken}`, {body: payload}) + await patch(`/platform/projects/{ref}/analytics/warehouse/collections/{token}`, { + params: { + path: { ref: projectRef, token: collectionToken }, + }, + body: payload, + } as any) // TODO: remove cast when openapi client generates correct types const keysToInvalidate = analyticsKeys.warehouseCollections(projectRef) queryClient.invalidateQueries(keysToInvalidate) }, - mutationKey: analyticsKeys.warehouseCollections(projectRef) + mutationKey: analyticsKeys.warehouseCollections(projectRef), }) return mutation