Skip to content

Commit

Permalink
๐Ÿ”จ Partial ์‚ฌ์šฉํ•ด์„œ ํผ ์ˆ˜์ •ํ•  ๊ฒฝ์šฐ์—๋Š” RequestCreateMogacoDto ํƒ€์ž…์„ ์ „๋ถ€ optional๋กœ ๋ฐ›์„ โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ์ˆ˜ ์žˆ๋„๋ก ์ˆ˜์ •
  • Loading branch information
ttaerrim committed Nov 29, 2023
1 parent 2ab4d97 commit f0bcfa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 7 additions & 3 deletions app/frontend/src/queries/hooks/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import { mogaco } from '@/services';
export const useSubmitEdit = () => {
const queryClient = useQueryClient();

// TODO: RequestCreateMogacoDto optional๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•˜์ง€ ์•Š์„๊นŒ?
return useMutation({
mutationFn: ({ id, form }: { id: string; form: RequestCreateMogacoDto }) =>
mogaco.edit(id, form),
mutationFn: ({
id,
form,
}: {
id: string;
form: Partial<RequestCreateMogacoDto>;
}) => mogaco.edit(id, form),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: queryKeys.mogaco.list().queryKey,
Expand Down
3 changes: 1 addition & 2 deletions app/frontend/src/services/mogaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export const mogaco = {
},
post: async (form: RequestCreateMogacoDto) =>
morakAPI.post(mogaco.endPoint.index, form),
// TODO: RequestCreateMogacoDto optional๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•˜์ง€ ์•Š์„๊นŒ?
edit: async (id: string, form: RequestCreateMogacoDto) =>
edit: async (id: string, form: Partial<RequestCreateMogacoDto>) =>
morakAPI.patch(`${mogaco.endPoint.index}/${id}`, form),
delete: async (id: string) => {
const response = await morakAPI.delete(`${mogaco.endPoint.index}/${id}`);
Expand Down

0 comments on commit f0bcfa0

Please sign in to comment.