Skip to content

Commit 251abd8

Browse files
authored
Merge pull request #99 from gyoyeon-kim/card-table
[Feat] Moadal : 초대받은 대시보드
2 parents ea5b498 + 0095722 commit 251abd8

File tree

13 files changed

+263
-92
lines changed

13 files changed

+263
-92
lines changed

src/api/apiRoutes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const apiRoutes = {
2626
DashboardInviteDelete: (dashboardId: number, invitationId: number) =>
2727
`/${TEAM_ID}/dashboards/${dashboardId}/invitations/${invitationId}`, //delete
2828
//초대 받은 대시보드
29-
Invitations: () => `/${TEAM_ID}/members`, //get
29+
Invitations: () => `/${TEAM_ID}/invitations`, //get
3030
invitationDetail: (invitationId: number) =>
3131
`/${TEAM_ID}/invitations/${invitationId}`, //put
3232
// [Members]

src/api/axiosInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const axiosInstance = axios.create({
99

1010
// ✅ Authorization 헤더 자동 추가
1111
axiosInstance.interceptors.request.use((config) => {
12-
const token = localStorage.getItem("accessToken");
12+
const token = localStorage.getItem("accessToken"); // localStorage에서 토큰 가져오기
1313
if (token) {
14-
config.headers.Authorization = `Bearer ${token}`;
14+
config.headers.Authorization = `Bearer ${token}`; // 헤더에 Authorization 추가
1515
}
1616
return config;
1717
});

src/api/user.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ interface UserResponse {
77
profileImageUrl: string;
88
createdAt: string;
99
updatedAt: string;
10+
isOwner?: boolean;
11+
userId?: number;
1012
}
1113

1214
export const getUserInfo = async ({ teamId }: { teamId: string }) => {

src/components/modal/ChangeBebridge.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ const ChangeBebridge = () => {
6868

6969
return (
7070
<div className="sm:w-[620px] sm:h-[344px] w-[327px] h-[312px] bg-white sm:rounded-[16px] rounded-[8px] p-[24px] flex flex-col">
71-
<h2 className="text-sm sm:text-[24px] font-bold">비브리지</h2>
71+
<h2 className="text-sm sm:text-[24px] font-bold">
72+
{dashboardDetail.title}
73+
</h2>
7274
<Input
7375
type="text"
7476
onChange={setTitle}
75-
label={`대시보드 이름 : ${dashboardDetail?.title || ""}`}
77+
label="대시보드 이름"
7678
labelClassName="text-lg sm:text-base text-black3 mt-6"
7779
placeholder="뉴프로젝트"
7880
className="max-w-[620px] mb-1"

src/components/modal/InviteDashboard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ export default function InviteDashboard({ onClose }: { onClose?: () => void }) {
3939
alert("초대 권한이 없습니다.");
4040
} else if (error.response?.status === 404) {
4141
alert("대시보드 또는 유저가 존재하지 않습니다.");
42+
} else if (error.response?.status === 409) {
43+
alert("이미 대시보드에 초대된 멤버입니다.");
4244
} else {
4345
alert("오류가 발생했습니다.");
4446
}
47+
// Next.js가 감지하기 전에 강제 새로고침 실행 > 추후 더 좋은 방법 있으면 변경
48+
setTimeout(() => {
49+
window.location.reload();
50+
}, 50);
4551
} else {
4652
alert("네트워크 오류가 발생했습니다.");
4753
}
48-
49-
window.location.reload();
5054
}
5155
};
5256

src/components/modal/NewDashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function NewDashboard({ onClose }: { onClose?: () => void }) {
1010

1111
const colors = ["#7ac555", "#760DDE", "#FF9800", "#76A5EA", "#E876EA"];
1212

13-
const token = process.env.NEXT_PUBLIC_API_TOKEN;
13+
const token = localStorage.getItem("accessToken");
1414

1515
const handleSubmit = async () => {
1616
const payload = {

src/components/table/invited/EmptyInvitations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function EmptyInvitations() {
22
return (
3-
<div className="relative sm:w-[960px] w-[260px] sm:h-[390px] h:[327px] rounded-[16px] sm:p-[24px_40px_120px_40px] p-[24px_20px_80px_20px] bg-white shadow-md mx-auto">
3+
<div className="relative sm:w-[960px] w-[260px] sm:h-[390px] h:[327px] rounded-[16px] sm:p-[24px_40px_120px_40px] p-[24px_20px_80px_20px] bg-white shadow-md">
44
<div className="flex justify-between ">
55
<p className="sm:text-2xl text-sm font-bold mb-4 ">초대받은 대시보드</p>
66
</div>

0 commit comments

Comments
 (0)