Skip to content

Commit

Permalink
feat: checklist의 structure NONE일 경우 null로 보내지게 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
skiende74 committed Sep 27, 2024
1 parent e345736 commit 612aae4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/apis/checklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ export const getChecklists = async () => {
};

export const postChecklist = async (checklist: ChecklistPostForm) => {
checklist.room.structure = checklist.room.structure === 'NONE' ? undefined : checklist.room.structure;
checklist.room = mapObjUndefinedToNull(checklist.room);
const response = await fetcher.post({ url: BASE_URL + ENDPOINT.CHECKLISTS, body: checklist });
return response;
};

export const putChecklist = async (id: number, checklist: ChecklistPostForm) => {
checklist.room.structure = checklist.room.structure === 'NONE' ? undefined : checklist.room.structure;
checklist.room = mapObjUndefinedToNull(checklist.room);
const response = await fetcher.put({ url: BASE_URL + ENDPOINT.CHECKLIST_ID(id), body: checklist });
return response;
Expand Down

0 comments on commit 612aae4

Please sign in to comment.