-
-
- 초대받은 대시보드
-
-
{token}
-
-
+
+
+
+ 초대받은 대시보드
+
+
+ {items.length === 0 && (
+
+
+
+
+
+ 아직 초대받은 대시보드가 없어요
+
+
+ )}
+ {items.length > 0 && (
+ <>
+
+
+ 이름
+ 초대자
+ 수락 여부
+
+
+ {items.map((item, index) => (
+
+
+
+ ))}
+
+
+ >
+ )}
);
}
diff --git a/src/components/common/pagenation-button/PagenationButton.tsx b/src/components/common/pagination-button/PaginationButton.tsx
similarity index 100%
rename from src/components/common/pagenation-button/PagenationButton.tsx
rename to src/components/common/pagination-button/PaginationButton.tsx
diff --git a/src/components/modal/task-detail/CommentCard.tsx b/src/components/modal/task-detail/CommentCard.tsx
index 3bf651c..56c7abf 100644
--- a/src/components/modal/task-detail/CommentCard.tsx
+++ b/src/components/modal/task-detail/CommentCard.tsx
@@ -49,8 +49,8 @@ export default function CommentCard({
onChange();
};
- const handleDeleteComment = () => {
- deleteComment({
+ const handleDeleteComment = async () => {
+ await deleteComment({
token: accessToken,
commentId: id,
});
diff --git a/src/lib/apis/invitationsApi.ts b/src/lib/apis/invitationsApi.ts
new file mode 100644
index 0000000..a93330b
--- /dev/null
+++ b/src/lib/apis/invitationsApi.ts
@@ -0,0 +1,54 @@
+import { BASE_URL } from "@/lib/constants/urls";
+
+export async function fetchInvitationList({
+ token,
+ size,
+ cursorId,
+ title,
+}: {
+ token: string;
+ size: number;
+ cursorId: number | null;
+ title: string;
+}) {
+ let query = `size=${size}`;
+ if (cursorId !== null) {
+ query += `&cursorId=${cursorId}`;
+ }
+ if (title !== "") {
+ query += `&title=${title}`;
+ }
+ const res = await fetch(`${BASE_URL}/invitations?${query}`, {
+ headers: {
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ },
+ cache: "no-store",
+ });
+
+ return res.json();
+}
+
+export async function putInvitation({
+ token,
+ invitationId,
+ inviteAccepted,
+}: {
+ token: string;
+ invitationId: number;
+ inviteAccepted: boolean;
+}) {
+ const res = await fetch(`${BASE_URL}/invitations/${invitationId}`, {
+ method: "PUT",
+ headers: {
+ Accept: "application/json",
+ Authorization: `Bearer ${token}`,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ inviteAccepted,
+ }),
+ });
+
+ return res.json();
+}
diff --git a/src/lib/apis/membersApi.ts b/src/lib/apis/membersApi.ts
index dfe4b10..345715d 100644
--- a/src/lib/apis/membersApi.ts
+++ b/src/lib/apis/membersApi.ts
@@ -29,14 +29,12 @@ export async function fetchDashboardMember({
export async function deleteDashboardMember({
token,
- dashboardId,
memberId,
}: {
token: string;
- dashboardId: number;
memberId: number;
}) {
- await fetch(`${BASE_URL}/dashboards/${dashboardId}/members/${memberId}`, {
+ await fetch(`${BASE_URL}/members/${memberId}`, {
method: "DELETE",
headers: {
Accept: "application/json",