Skip to content

Commit 4dfe871

Browse files
committed
feat: [FN-350]저장하기 이후 피드백 토스트 추가
1 parent 71ec919 commit 4dfe871

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/features/cardset/components/cardset-editor.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState, useEffect, useRef, useCallback } from "react";
2+
import { toast } from "sonner";
23
import { Button } from "@/shared/components/button";
34
import { Textarea } from "@/shared/components/textarea";
45
import { useYjs } from "@/shared/socket/use-yjs";
@@ -546,7 +547,12 @@ export function CardsetEditor({ cardsetId }: CardsetEditorProps) {
546547
</div>
547548
<Button
548549
size="sm"
549-
onClick={() => apiClient.post(`card-sets/${cardsetId}`)}
550+
onClick={() =>
551+
apiClient
552+
.post(`card-sets/${cardsetId}`)
553+
.then(() => toast.success("저장되었습니다."))
554+
.catch(() => toast.error("저장에 실패했습니다."))
555+
}
550556
className="flex items-center gap-1.5 h-8 px-3 text-xs"
551557
>
552558
<Save className="w-3.5 h-3.5" />

0 commit comments

Comments
 (0)