From 22ae3ef0da635420886c766f1cd0af9e3b488d8e Mon Sep 17 00:00:00 2001 From: Jeongmin Lee Date: Tue, 8 Oct 2024 04:00:20 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=B1=83=EC=A7=80=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?API=20Type=20=EC=84=A0=EC=96=B8=20#53?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/user/badges/badges.ts | 15 +++++++++++++++ src/apis/user/badges/badgesType.ts | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/apis/user/badges/badges.ts create mode 100644 src/apis/user/badges/badgesType.ts diff --git a/src/apis/user/badges/badges.ts b/src/apis/user/badges/badges.ts new file mode 100644 index 0000000..4a9410f --- /dev/null +++ b/src/apis/user/badges/badges.ts @@ -0,0 +1,15 @@ +"use server"; + +import instance from "@/apis/instance"; +import { FIESTA_ENDPOINTS } from "@/config"; + +import { BadgesResponse } from "./badgesType"; + +export const getUserBadges = async () => { + const endpoint = FIESTA_ENDPOINTS.users.badges; + const { data } = await instance.get(endpoint, { + next: { revalidate: 3600 }, + }); + + return data; +}; diff --git a/src/apis/user/badges/badgesType.ts b/src/apis/user/badges/badgesType.ts new file mode 100644 index 0000000..f66c036 --- /dev/null +++ b/src/apis/user/badges/badgesType.ts @@ -0,0 +1,9 @@ +export type Badge = { + badgeId: number; + badgeName: string; + description: string; + imageUrl: string; + isAquired: boolean; +}; + +export type BadgesResponse = Array;