Skip to content

Commit 8f1d787

Browse files
authored
Merge pull request #139 from part3-4team-Taskify/feature/Gnb
[Fix] 배포 에러: POST api 한정, apiRoutes 사용 시 에러 발생, fix
2 parents 16ef26a + 6a85735 commit 8f1d787

File tree

9 files changed

+31
-32
lines changed

9 files changed

+31
-32
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"postcss": "^8.5.3",
4242
"prettier": "^3.5.3",
4343
"tailwindcss": "^4.0.14",
44-
"typescript": "^5"
44+
"typescript": "^5.8.2"
4545
}
4646
}

src/api/auth.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axiosInstance from "./axiosInstance";
2-
import { apiRoutes } from "./apiRoutes";
32
import { UserType } from "@/types/users";
3+
import { TEAM_ID } from "@/constants/team";
44

55
interface AuthResponse extends UserType {
66
accessToken: string;
@@ -13,10 +13,13 @@ export const postAuthData = async ({
1313
email: string;
1414
password: string;
1515
}) => {
16-
const response = await axiosInstance.post<AuthResponse>(apiRoutes.login(), {
17-
email,
18-
password,
19-
});
16+
const response = await axiosInstance.post<AuthResponse>(
17+
`${TEAM_ID}/auth/login`,
18+
{
19+
email,
20+
password,
21+
}
22+
);
2023

2124
return response.data;
2225
};

src/api/card.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import axiosInstance from "./axiosInstance";
22
import type { CardDetailType } from "@/types/cards"; // Dashboard 타입 import
33
import { apiRoutes } from "@/api/apiRoutes";
4+
import { TEAM_ID } from "@/constants/team";
45

56
/** 1. 카드 이미지 업로드 */
67
export const uploadCardImage = async ({
@@ -14,7 +15,7 @@ export const uploadCardImage = async ({
1415
formData.append("image", imageFile);
1516

1617
const response = await axiosInstance.post(
17-
apiRoutes.columnCardImage(columnId),
18+
`/${TEAM_ID}/columns/${columnId}/card-image`,
1819
formData,
1920
{
2021
headers: {
@@ -46,7 +47,7 @@ export const createCard = async ({
4647
tags: string[];
4748
imageUrl?: string;
4849
}) => {
49-
const response = await axiosInstance.post(apiRoutes.cards(), {
50+
const response = await axiosInstance.post(`/${TEAM_ID}/cards`, {
5051
assigneeUserId,
5152
dashboardId,
5253
columnId,

src/api/columns.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ColumnType } from "@/types/task";
22
import axiosInstance from "./axiosInstance";
33
import { apiRoutes } from "./apiRoutes";
4+
import { TEAM_ID } from "@/constants/team";
45

56
// 칼럼 생성
67
export const createColumn = async ({
@@ -10,7 +11,7 @@ export const createColumn = async ({
1011
title: string;
1112
dashboardId: number;
1213
}): Promise<ColumnType> => {
13-
const res = await axiosInstance.post(apiRoutes.columns(), {
14+
const res = await axiosInstance.post(`/${TEAM_ID}/columns`, {
1415
title,
1516
dashboardId,
1617
});

src/api/comment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import {
55
UpdateCommenttype,
66
DeleteCommentParams,
77
} from "../types/comments";
8+
import { TEAM_ID } from "@/constants/team";
89

910
// 댓글 생성
1011
export const createComment = async (data: CreateCommentType) => {
11-
const response = await axiosInstance.post(apiRoutes.comments(), data);
12+
const response = await axiosInstance.post(`/${TEAM_ID}/comments`, data);
1213
return response.data;
1314
};
1415

src/api/dashboards.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import axiosInstance from "./axiosInstance";
22
import { apiRoutes } from "./apiRoutes";
3+
import { TEAM_ID } from "@/constants/team";
34

45
export interface Dashboard {
56
id: number;
@@ -19,7 +20,7 @@ export const createDashboard = async ({
1920
title: string;
2021
color: string;
2122
}) => {
22-
const res = await axiosInstance.post(apiRoutes.dashboards(), {
23+
const res = await axiosInstance.post(`/${TEAM_ID}/dashboards`, {
2324
title,
2425
color,
2526
});
@@ -30,7 +31,7 @@ export const createDashboard = async ({
3031
export const getDashboards = async ({
3132
navigationMethod = "pagination",
3233
page = 1,
33-
size = 10,
34+
size = 100,
3435
}: {
3536
navigationMethod?: "pagination";
3637
page?: number;

src/api/hello.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/api/users.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import axiosInstance from "./axiosInstance";
22
import { apiRoutes } from "./apiRoutes";
33
import { UpdateUser, UserMeImage } from "@/types/users";
44
import { UserType } from "@/types/users";
5+
import { TEAM_ID } from "@/constants/team";
56

67
interface SignUpRequest {
78
email: string;
@@ -12,7 +13,7 @@ interface SignUpRequest {
1213
// 회원가입 (POST)
1314
export const signUp = async ({ payload }: { payload: SignUpRequest }) => {
1415
const response = await axiosInstance.post<SignUpRequest>(
15-
apiRoutes.users(),
16+
`/${TEAM_ID}/users`,
1617
payload
1718
);
1819
return response.data;
@@ -38,10 +39,14 @@ export const updateProfile = async (data: UpdateUser) => {
3839
export const uploadProfileImage = async (
3940
formData: FormData
4041
): Promise<UserMeImage> => {
41-
const response = await axiosInstance.post(apiRoutes.userMeImage(), formData, {
42-
headers: {
43-
"Content-Type": "multipart/form-data",
44-
},
45-
});
42+
const response = await axiosInstance.post(
43+
`/${TEAM_ID}/users/me/image`,
44+
formData,
45+
{
46+
headers: {
47+
"Content-Type": "multipart/form-data",
48+
},
49+
}
50+
);
4651
return response.data;
4752
};

0 commit comments

Comments
 (0)