diff --git a/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx b/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx
index 897b72e62..1bff638f8 100644
--- a/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx
+++ b/apps/common/features/src/pages/(pst)/notice/ui/modify-page.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useMutation, useQuery } from "@tanstack/react-query";
@@ -10,7 +11,7 @@ import {
type PostUpdateFormData,
} from "@/entities/post";
import { ENDPOINT } from "@/shared/config";
-import { useAlertStore, useUserStore } from "@/shared/lib";
+import { setCookie, useAlertStore, useUserStore } from "@/shared/lib";
function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const { setMessage: alert } = useAlertStore((state) => state);
@@ -38,6 +39,10 @@ function ModifyPage({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
},
});
+ useEffect(() => {
+ setCookie("atfl-cd-key", "");
+ }, []);
+
return (
diff --git a/apps/common/features/src/widgets/post/ui/post-form.tsx b/apps/common/features/src/widgets/post/ui/post-form.tsx
index fc3912780..e603e91f1 100644
--- a/apps/common/features/src/widgets/post/ui/post-form.tsx
+++ b/apps/common/features/src/widgets/post/ui/post-form.tsx
@@ -257,39 +257,36 @@ function PostForm
({
}
- render={({ field }) => (
-
-
- ) ===
- "N"
- }
- handlePeriodValueChange={(periodCode) => {
- field.onChange([
- {
- ...(form.getValues().popupYnEtc?.[0] ?? {}),
- bbsPstgTypeCd: BOARD_POSTING_CODE.팝업게시,
- pstgPrdSeCd: periodCode,
- },
- ]);
- }}
- handlePostingDateChange={(date) => {
- field.onChange([
- {
- ...(form.getValues().popupYnEtc?.[0] ?? {}),
- ...date,
- },
- ]);
- }}
- />
-
-
- )}
+ render={({ field }) => {
+ const fieldValues = form.getValues().popupYnEtc?.[0];
+ return (
+
+
+ ) ===
+ "N"
+ }
+ handlePeriodValueChange={(periodCode, date) => {
+ field.onChange([
+ {
+ ...fieldValues,
+ ...date,
+ bbsPstgTypeCd:
+ BOARD_POSTING_CODE.팝업게시,
+ pstgPrdSeCd: periodCode,
+ },
+ ]);
+ }}
+ handlePostingDateChange={(date) => {
+ field.onChange([{ ...fieldValues, ...date }]);
+ }}
+ />
+
+
+ );
+ }}
/>
@@ -327,41 +324,37 @@ function PostForm
({
}
- render={({ field }) => (
-
-
- ) ===
- "N"
- }
- handlePeriodValueChange={(periodCode) => {
- field.onChange([
- {
- ...(form.getValues().upndFixYnEtc?.[0] ??
- {}),
- bbsPstgTypeCd: BOARD_POSTING_CODE.상단게시,
- pstgPrdSeCd: periodCode,
- },
- ]);
- }}
- handlePostingDateChange={(date) => {
- field.onChange([
- {
- ...(form.getValues().upndFixYnEtc?.[0] ??
- {}),
- ...date,
- },
- ]);
- }}
- />
-
-
- )}
+ render={({ field }) => {
+ const fieldValues = form.getValues().upndFixYnEtc?.[0];
+ return (
+
+
+ ,
+ ) === "N"
+ }
+ handlePeriodValueChange={(periodCode, date) => {
+ field.onChange([
+ {
+ ...fieldValues,
+ ...date,
+ bbsPstgTypeCd:
+ BOARD_POSTING_CODE.상단게시,
+ pstgPrdSeCd: periodCode,
+ },
+ ]);
+ }}
+ handlePostingDateChange={(date) => {
+ field.onChange([{ ...fieldValues, ...date }]);
+ }}
+ />
+
+
+ );
+ }}
/>
@@ -399,41 +392,37 @@ function PostForm
({
}
- render={({ field }) => (
-
-
- ) ===
- "N"
- }
- handlePeriodValueChange={(periodCode) => {
- field.onChange([
- {
- ...(form.getValues().prdPstgYnEtc?.[0] ??
- {}),
- bbsPstgTypeCd: BOARD_POSTING_CODE.기간게시,
- pstgPrdSeCd: periodCode,
- },
- ]);
- }}
- handlePostingDateChange={(date) => {
- field.onChange([
- {
- ...(form.getValues().prdPstgYnEtc?.[0] ??
- {}),
- ...date,
- },
- ]);
- }}
- />
-
-
- )}
+ render={({ field }) => {
+ const fieldValues = form.getValues().prdPstgYnEtc?.[0];
+ return (
+
+
+ ,
+ ) === "N"
+ }
+ handlePeriodValueChange={(periodCode, date) => {
+ field.onChange([
+ {
+ ...fieldValues,
+ ...date,
+ bbsPstgTypeCd:
+ BOARD_POSTING_CODE.기간게시,
+ pstgPrdSeCd: periodCode,
+ },
+ ]);
+ }}
+ handlePostingDateChange={(date) => {
+ field.onChange([{ ...fieldValues, ...date }]);
+ }}
+ />
+
+
+ );
+ }}
/>