Skip to content

Commit

Permalink
[FE] ✨ Feat : 방명록 관련 데이터 요청 로직 구현 (codestates-seb#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalsae committed Dec 12, 2023
1 parent 5c7df6c commit 15f4c2d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions client/src/api/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,25 @@ export const connectLeaf = async (

return data;
};

export const findGuestbookById = async (userId: string) => {
const { data } = await gardenAxios
.get(`/guestbooks/${userId}`)
.then((res) => res.data);

return data;
};

export const addGuestbook = async (userId: string, content: string) => {
return await gardenAxios.post(`/guestbooks/${userId}`, { content });
};

export const editGuestbook = async (guestbookId: string, content: string) => {
return await gardenAxios.patch(`/guestbooks/${guestbookId}`, {
content,
});
};

export const deleteGuestbook = async (guestbookId: string) => {
return await gardenAxios.delete(`/guestbooks/${guestbookId}`);
};

0 comments on commit 15f4c2d

Please sign in to comment.