Skip to content

Commit a0c1c8b

Browse files
committed
[Fix] 대시보드 api 호출 에러 해결
1 parent d50cc8e commit a0c1c8b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/components/modal/NewDashboard.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useState } from "react";
22
import Input from "../input/Input";
33
import Image from "next/image";
44
import axios from "axios";
5+
import { createDashboard } from "@/api/dashboards";
6+
import { TEAM_ID } from "@/constants/team";
57

68
interface Dashboard {
79
id: number;
@@ -39,17 +41,7 @@ export default function NewDashboard({
3941

4042
try {
4143
setLoading(true);
42-
const response = await axios.post(
43-
`${process.env.NEXT_PUBLIC_BASE_URL}/${teamId}/dashboards`,
44-
payload,
45-
{
46-
headers: {
47-
Authorization: `Bearer ${token}`,
48-
"Content-Type": "application/json",
49-
},
50-
}
51-
);
52-
44+
const response = await createDashboard(payload);
5345
onCreate?.(response.data);
5446
onClose?.();
5547
} catch {

0 commit comments

Comments
 (0)