fix: atflCd 쿠키 초기화 로직 추가
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user