refactor: useAlertStore 사용부 리팩토링
This commit is contained in:
@@ -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>>(
|
||||
|
||||
@@ -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>("");
|
||||
|
||||
|
||||
@@ -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("");
|
||||
|
||||
Reference in New Issue
Block a user