refactor: base crud hook

This commit is contained in:
2025-08-23 10:28:31 +04:00
parent b105510c23
commit f2084ae3d4
13 changed files with 355 additions and 403 deletions

View File

@ -161,7 +161,7 @@ export const deleteBoard = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zDeleteBoardResponse2.parseAsync(data);
},
url: "/board/{boardId}",
url: "/board/{pk}",
...options,
});
};
@ -184,7 +184,7 @@ export const updateBoard = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zUpdateBoardResponse2.parseAsync(data);
},
url: "/board/{boardId}",
url: "/board/{pk}",
...options,
headers: {
"Content-Type": "application/json",
@ -311,7 +311,7 @@ export const deleteProject = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zDeleteProjectResponse2.parseAsync(data);
},
url: "/project/{projectId}",
url: "/project/{pk}",
...options,
});
};
@ -334,7 +334,7 @@ export const updateProject = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zUpdateProjectResponse2.parseAsync(data);
},
url: "/project/{projectId}",
url: "/project/{pk}",
...options,
headers: {
"Content-Type": "application/json",
@ -411,7 +411,7 @@ export const deleteStatus = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zDeleteStatusResponse2.parseAsync(data);
},
url: "/status/{statusId}",
url: "/status/{pk}",
...options,
});
};
@ -434,7 +434,7 @@ export const updateStatus = <ThrowOnError extends boolean = false>(
responseValidator: async data => {
return await zUpdateStatusResponse2.parseAsync(data);
},
url: "/status/{statusId}",
url: "/status/{pk}",
...options,
headers: {
"Content-Type": "application/json",