refactor: useAlertStore 사용부 리팩토링

This commit is contained in:
2025-05-28 16:25:00 +09:00
parent f06a8e9637
commit 34ed19d14e
70 changed files with 70 additions and 73 deletions
@@ -17,7 +17,7 @@ function GeneralFileUploader<T extends { atflCd?: string | null }>({
deleteAttachmentIds: string[];
setDeleteAttachmentIds: (deleteAttachmentIds: string[]) => void;
}) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo } = useMenuStore((state) => state);
const [attachments, setAttachments] = useState<Record<string, Attachment>>(
+1 -1
View File
@@ -20,7 +20,7 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) {
const { confirm } = useConfirm();
const queryClient = useQueryClient();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [editingCmntNo, setEditingCmntNo] = useState<number | null>(null);
const [editValue, setEditValue] = useState<string>("");
+1 -1
View File
@@ -16,7 +16,7 @@ import { BoardApi } from "@/entities/board";
function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo, setBbsInfo } = useMenuStore((state) => state);
const [filename, setFilename] = useState("");
@@ -16,7 +16,7 @@ function WithPreviewFileUploader<T extends PostFormData | PostUpdateFormData>({
form: UseFormReturn<T>;
attachmentData?: Attachment[];
}) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo } = useMenuStore((state) => state);
const [thumbnailUrl, setThumbnailUrl] = useState("");