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;