fix: atflCd 쿠키 초기화 로직 추가

This commit is contained in:
2025-04-08 16:28:27 +09:00
parent 07ee7adca5
commit 2eb9eb9370
3 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -22,6 +22,7 @@ import { FormWrapper } from "@/widgets/form-wrapper";
import { CodeSelect } from "@/entities/code";
import { AttachmentApi } from "@/entities/attachment";
import { ENDPOINT } from "@/shared/config";
import { setCookie } from "@/shared/lib/cookie";
import { FormControl, FormField, FormItem } from "@/shared/ui/form";
import type { ImageFormData } from "../model/image-interface";
import { handleUpload } from "../lib/utils";
@@ -64,11 +65,9 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
};
useEffect(() => {
if (!attachmentData) return;
(async () => {
setImageUrl(
await AttachmentApi.getImageUrlByAtflCd(attachmentData.atflCd),
await AttachmentApi.getImageUrlByAtflCd(attachmentData?.atflCd ?? ""),
);
})();
}, [attachmentData]);
@@ -198,6 +197,7 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
onUpload={(e) => {
const files = e.target.files;
if (!files) return;
setCookie("atfl-cd-key", "");
handleUpload(files, {
handleUploadStart: setUpload,
handleProgress,