Skip to content

Commit 4c886c6

Browse files
committed
feat: [FN-257] 저장하기 연동
1 parent 7fc71b4 commit 4c886c6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/features/cardset/components/CardsetEditor.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Label } from "@/shared/components/label";
66
import { useYjs } from "@/shared/socket/useYjs";
77
import type { CardData } from "@/shared/socket/card-types";
88
import * as Y from "yjs";
9+
import {nestClient} from "@/shared/apis/fetch";
910

1011
type CardsetEditorProps = {
1112
cardsetId: string;
@@ -325,6 +326,10 @@ export function CardsetEditor({ cardsetId }: CardsetEditorProps) {
325326
</h1>
326327
<div className="flex items-center gap-3 text-sm text-gray-500 bg-gray-100 px-3 py-2 rounded-lg">
327328
<span>총 {cards.length}개 카드</span>
329+
<Button type={'button'} onClick={(e)=>{
330+
e.preventDefault()
331+
nestClient.post(`/api/v1/card-sets/${cardsetId}`)
332+
}}>저장하기</Button>
328333
</div>
329334
</div>
330335
</div>

‎src/shared/apis/fetch.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ apiClient.interceptors.response.use(
6060
);
6161

6262
export default apiClient;
63+
64+
export const nestClient = axios.create({
65+
baseURL:"http://localhost:3000"
66+
})

0 commit comments

Comments
 (0)