Skip to content

Commit 5110603

Browse files
committed
feat: prepared remove mutation 추가
1 parent 563f9ad commit 5110603

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/common/src/apis/admin_api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ namespace BackendAdminAPIs {
4747
export const remove = (client: BackendAPIClient, app: string, resource: string, id: string) => () =>
4848
client.delete<void>(`v1/admin-api/${app}/${resource}/${id}/`);
4949

50+
export const removePrepared = (client: BackendAPIClient, app: string, resource: string) => (id: string) =>
51+
client.delete<void>(`v1/admin-api/${app}/${resource}/${id}/`);
52+
5053
export const schema = (client: BackendAPIClient, app: string, resource: string) => () =>
5154
client.get<BackendAdminAPISchemas.AdminSchemaDefinition>(`v1/admin-api/${app}/${resource}/json-schema/`);
5255

packages/common/src/hooks/useAdminAPI.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ namespace BackendAdminAPIHooks {
9393
mutationFn: BackendAdminAPIs.remove(client, app, resource, id),
9494
});
9595

96+
export const useRemovePreparedMutation = (client: BackendAPIClient, app: string, resource: string) =>
97+
useMutation({
98+
mutationKey: [...MUTATION_KEYS.ADMIN_REMOVE, app, resource, "prepared"],
99+
mutationFn: BackendAdminAPIs.removePrepared(client, app, resource),
100+
});
101+
96102
export const useUploadPublicFileMutation = (client: BackendAPIClient) =>
97103
useMutation({
98104
mutationKey: [...MUTATION_KEYS.ADMIN_CREATE, "public-file", "upload"],

0 commit comments

Comments
 (0)