Skip to content

Commit

Permalink
✨ feat: 마이페이지 뱃지 관련 API Type 선언 #53
Browse files Browse the repository at this point in the history
  • Loading branch information
froggy1014 committed Oct 7, 2024
1 parent c7195b5 commit 22ae3ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/apis/user/badges/badges.ts
Original file line number Diff line number Diff line change
@@ -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<BadgesResponse>(endpoint, {
next: { revalidate: 3600 },
});

return data;
};
9 changes: 9 additions & 0 deletions src/apis/user/badges/badgesType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type Badge = {
badgeId: number;
badgeName: string;
description: string;
imageUrl: string;
isAquired: boolean;
};

export type BadgesResponse = Array<Badge>;

0 comments on commit 22ae3ef

Please sign in to comment.