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
@@ -33,7 +33,7 @@ function ManagementAuthorityDialog({
...props
}: ManagementAuthorityDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: menuAuthorityList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.MENU_AUTHRTS, menuCd],
@@ -13,7 +13,7 @@ const MenuWrapper = ({ children }: { children: React.ReactNode }) => {
const router = useRouter();
const pathname = usePathname();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const {
pageMenuAuthority,
setBbsInfo,
@@ -61,7 +61,7 @@ const POSTING_TYPE_LABEL = {
function PostingDialog({ postingType, postingTargets }: PostingDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [selectedRows, setSelectedRows] = useState<number[]>([]);
const [rememberPeriodCode, setRememberPeriodCode] = useState<
Record<string, string>
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -32,7 +32,7 @@ function FaqPage({ bbsId }: { bbsId: string }) {
const pathname = usePathname();
const { confirm } = useConfirm();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo, pageMenuAuthority } = useMenuStore((state) => state);
const [postParams, setPostParams] = useState<PostParams>({
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -13,7 +13,7 @@ function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -6,7 +6,6 @@ import {
Button,
} from "@common/components";
import { useAlertStore } from "../lib/use-alert-store";
function AlertDialog() {
const { message, callback, setMessage } = useAlertStore((state) => state);
const handleOpenChange = () => {
@@ -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>("");
@@ -21,7 +21,7 @@ import { PostComment } from "./post-comment";
function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { prompt } = usePrompt();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { bbsInfo } = useMenuStore((state) => state);
@@ -168,7 +168,7 @@ function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
<video src={videoUrl} controls className="object-contain" />
</div>
)}
<pre className="font-noto min-h-[40rem] whitespace-pre-wrap p-8 text-2xl tracking-tighter text-foreground">
<pre className="min-h-[40rem] whitespace-pre-wrap p-8 font-noto text-2xl tracking-tighter text-foreground">
{postData?.pstCn ?? ""}
</pre>
{isFetching ? (
@@ -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("");
@@ -33,7 +33,7 @@ function ManagementAuthorityDialog({
...props
}: ManagementAuthorityDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: menuAuthorityList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.MENU_AUTHRTS, menuCd],
@@ -12,7 +12,7 @@ const MenuWrapper = ({ children }: { children: React.ReactNode }) => {
const router = useRouter();
const pathname = usePathname();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { pageMenuAuthority, setCurrentMenuInfo, setPageMenuAuthority } =
useMenuStore((state) => state);
@@ -58,11 +58,12 @@ const POSTING_TYPE_LABEL = {
POPUP: "팝업",
BANNER: "배너",
IMAGE: "이미지",
SURVEY: "설문",
} as const;
function PostingDialog({ postingType, postingTargets }: PostingDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [selectedRows, setSelectedRows] = useState<number[]>([]);
const [rememberPeriodCode, setRememberPeriodCode] = useState<
Record<string, string>
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
+1 -1
View File
@@ -30,7 +30,7 @@ function FaqPage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const pathname = usePathname();
const { prompt } = usePrompt();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo } = useMenuStore((state) => state);
const [postParams, setPostParams] = useState<PostParams>({
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -13,7 +13,7 @@ function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
@@ -11,7 +11,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function CreatePage({ bbsId }: { bbsId: string }) {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPost } = useMutation({
mutationFn: (data: PostFormData) => PostApi.createPost(data),
@@ -15,7 +15,7 @@ import { useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { data: postInfo } = useQuery({
+1 -1
View File
@@ -14,7 +14,7 @@ import { BannerForm } from "./banner-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createBanner } = useMutation({
mutationFn: (data: BannerFormData) => BannerApi.createBanner(data),
+1 -1
View File
@@ -27,7 +27,7 @@ function ModifyPage({ sequential }: { sequential: string }) {
const router = useRouter();
const { confirm } = useConfirm();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
+1 -1
View File
@@ -14,7 +14,7 @@ import { BbsForm } from "./bbs-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createBoard } = useMutation({
mutationFn: (data: BoardFormData) => BoardApi.createBoard(data),
+1 -1
View File
@@ -13,7 +13,7 @@ import {
import { BbsForm } from "./bbs-form";
function ModifyPage({ bbsId }: { bbsId: string }) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: boardInfo } = useQuery({
queryKey: [ENDPOINT.BOARD_SERVICE.BBS, bbsId],
@@ -52,7 +52,7 @@ const LwpoCodeManagementDialog = memo(
const isRegistration = !lwpoCd;
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: detailData } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.LWPO_CODE, upCd, lwpoCd],
+1 -1
View File
@@ -51,7 +51,7 @@ const UpCodeManagementDialog = memo(
const isRegistration = !upCd;
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: detailData } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.UP_CODE, upCd],
@@ -14,7 +14,7 @@ import { ContentsForm } from "./contents-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createContents } = useMutation({
mutationFn: (data: ContentsFormData) => ContentsApi.createContents(data),
@@ -26,7 +26,7 @@ import {
function ModifyPage({ sequential }: { sequential: string }) {
const { confirm } = useConfirm();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const contsSn = parseInt(sequential);
const [contsVer, setContsVer] = useState(0);
+1 -1
View File
@@ -16,7 +16,7 @@ import { createColumns } from "../model/table-columns";
function FilePage() {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [attachmentQuery, setAttachmentQuery] = useState<AttachmentParams>({
keyword: "",
+1 -1
View File
@@ -11,7 +11,7 @@ import { ImageForm } from "./image-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createImage } = useMutation({
mutationFn: (data: ImageFormData) => ImageApi.createImage(data),
+1 -1
View File
@@ -24,7 +24,7 @@ function ModifyPage({ sequential }: { sequential: string }) {
const router = useRouter();
const { confirm } = useConfirm();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
+1 -1
View File
@@ -30,7 +30,7 @@ import { generateMenuTreeData } from "../lib/utils";
function MenuPage() {
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { confirm } = useConfirm();
const [siteId, setSiteId] = useState("");
+1 -1
View File
@@ -14,7 +14,7 @@ import { ModuleForm } from "./module-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createAuthorization } = useMutation({
mutationFn: (data: AuthorizationFormData) =>
@@ -44,7 +44,7 @@ type ManagementAuthorityDialogProps = {
const ManagementAuthorityDialog = memo(
({ authorizationNo, rowData, ...props }: ManagementAuthorityDialogProps) => {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [isOpened, setIsOpened] = useState(false);
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
+1 -1
View File
@@ -13,7 +13,7 @@ import { AuthorizationsApi } from "../api/authorization-service";
import { ModuleForm } from "./module-form";
function ModifyPage({ sequential }: { sequential: string }) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: authorizationInfo } = useQuery({
queryKey: [ENDPOINT.USER_SERVICE.AUTHORIZATIONS, sequential],
@@ -24,7 +24,7 @@ import { UserOrganizationSection } from "./user-organization-section";
function OrganizationPage() {
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { confirm } = useConfirm();
const [additionalNode, setAdditionalNode] =
@@ -48,7 +48,7 @@ type UserOrganizationSectionProps = {
function UserOrganizationSection({ ognzSn }: UserOrganizationSectionProps) {
const queryClient = useQueryClient();
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [userList, setUserList] = useState<User[]>([]);
const [selectedUsers, setSelectedUsers] = useState<User[]>([]);
+1 -1
View File
@@ -13,7 +13,7 @@ import { PopupForm } from "./popup-form";
function CreatePage() {
const router = useRouter();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createPopup } = useMutation({
mutationFn: (data: PopupFormData) => PopupApi.createPopup(data),
+1 -1
View File
@@ -29,7 +29,7 @@ function ModifyPage({ popupSn }: { popupSn: number }) {
const queryClient = useQueryClient();
const { confirm } = useConfirm();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
+1 -1
View File
@@ -46,7 +46,7 @@ function RecentPage() {
const router = useRouter();
const { prompt } = usePrompt();
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [dateRange, setDateRange] = useState<DateRange>();
const [pagination, setPagination] = useState<PaginationState>({
pageIndex: 0,
@@ -19,7 +19,7 @@ function CreatePage() {
const router = useRouter();
const searchParams = useSearchParams();
const dateStr = searchParams?.get("dateStr");
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createSchedule } = useMutation({
mutationFn: ScheduleApi.createSchedule,
@@ -17,7 +17,7 @@ import { generateRepeatDto } from "../lib/utils";
function ModifyPage({ schdlSn }: { schdlSn: string }) {
const router = useRouter();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: scheduleInfo } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SCHEDULES, schdlSn],
+1 -1
View File
@@ -10,7 +10,7 @@ import { SiteForm } from "./site-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createSite } = useMutation({
mutationFn: (data: SiteFormData) => SiteApi.createSite(data),
onSuccess: () => {
@@ -47,7 +47,7 @@ function DomainManagementDialog({
...props
}: DomainManagementDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: domainList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.DOMAINS, props.open],
@@ -43,7 +43,7 @@ function IPManagementDialog({
...props
}: IPManagementDialogProps) {
const { confirm } = useConfirm();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: ipList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.IPS, props.open],
+1 -1
View File
@@ -12,7 +12,7 @@ import { SiteForm } from "./site-form";
function ModifyPage({ siteId }: { siteId: string }) {
const router = useRouter();
const queryClient = useQueryClient();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: siteDetail } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SITES, siteId],
+1 -1
View File
@@ -14,7 +14,7 @@ import { SurveyForm } from "./survey-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createSurvey } = useMutation({
mutationFn: (data: SurveyFormData) => SurveyApi.createSurvey(data),
+1 -1
View File
@@ -15,7 +15,7 @@ import { SurveyForm } from "./survey-form";
function ModifyPage({ srvySn }: { srvySn: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: surveyInfo } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.SURVEY, srvySn],
@@ -1,8 +1,5 @@
import {
Input,
Label,
RadioGroup,
RadioGroupItem,
Table,
TableBody,
TableCell,
@@ -14,7 +14,7 @@ import { TemplateForm } from "./template-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createTemplate } = useMutation({
mutationFn: (data: TemplateFormData) => TemplateApi.createTemplate(data),
@@ -15,7 +15,7 @@ import { TemplateForm } from "./template-form";
function ModifyPage({ sequential }: { sequential: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: templateDetail } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.TEMPLATE, sequential],
+1 -1
View File
@@ -11,7 +11,7 @@ import { TermsForm } from "./terms-form";
function CreatePage() {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { mutateAsync: createTerms } = useMutation({
mutationFn: (data: TermsFormData) => TermsApi.createTerms(data),
+1 -1
View File
@@ -12,7 +12,7 @@ import { TermsForm } from "./terms-form";
function ModifyPage({ sequential }: { sequential: string }) {
const router = useRouter();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { data: termsDetail } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.TERMS, sequential],
@@ -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("");