From 15f4c2d8aac34b597a649d7963baa8e8b1b52ef6 Mon Sep 17 00:00:00 2001 From: nalsae Date: Tue, 12 Dec 2023 15:50:58 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20=E2=9C=A8=20Feat=20:=20=EB=B0=A9?= =?UTF-8?q?=EB=AA=85=EB=A1=9D=20=EA=B4=80=EB=A0=A8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=9A=94=EC=B2=AD=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/garden.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/src/api/garden.ts b/client/src/api/garden.ts index 5308f673..5bb95cc7 100644 --- a/client/src/api/garden.ts +++ b/client/src/api/garden.ts @@ -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}`); +};