잠재수요처 상세정보 수정 완료
This commit is contained in:
@@ -10,9 +10,9 @@ import { ldrmntHeadListExport, ldrmntNodeListExport, ldrmntZod } from "./headLis
|
||||
const ldrmntHeadList = ldrmntHeadListExport;
|
||||
const ldrmntNodeList = ldrmntNodeListExport;
|
||||
|
||||
export type customLdrmntBdst = z.infer<typeof ldrmntZod>;
|
||||
export type customLdrmnt = z.infer<typeof ldrmntZod>;
|
||||
|
||||
const ldrmntRes: customLdrmntBdst[] = [];
|
||||
const ldrmntRes: customLdrmnt[] = [];
|
||||
|
||||
export type ldrmntState = {
|
||||
ldrmnt: {
|
||||
@@ -20,7 +20,7 @@ export type ldrmntState = {
|
||||
ldrmntNodeList: CommonTableProps[];
|
||||
excelList: [];
|
||||
isInit: boolean;
|
||||
ldrmntRes: customLdrmntBdst[];
|
||||
ldrmntRes: customLdrmnt[];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -28,6 +28,7 @@ type ldrmntActions = {
|
||||
ldrmntRegData: (data: any[]) => void,
|
||||
ldrmntInit: () => void;
|
||||
ldrmntSearch: (sggCd: string, coNm: string) => void;
|
||||
ldrmntUpdate: (ldrmntRes: customLdrmnt) => void;
|
||||
};
|
||||
|
||||
export type ldrmntType = ldrmntState & ldrmntActions;
|
||||
@@ -124,14 +125,23 @@ export const ldrmntActionsExport: (set: any) => ldrmntActions = (
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
ldrmntUpdate: async (ldrmntRes: customLdrmntBdst[]) => {
|
||||
ldrmntUpdate: async (ldrmntRes: customLdrmnt) => {
|
||||
try {
|
||||
|
||||
console.log("ldrmntRes", ldrmntRes)
|
||||
const response = await putFectch(
|
||||
`/reuseFc/request/temp`,
|
||||
ldrmntRes
|
||||
);
|
||||
|
||||
return set((state: ldrmntState) => ({
|
||||
...state,
|
||||
ldrmnt: {
|
||||
...state.ldrmnt,
|
||||
ldrmntRes: ldrmntRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error ldrmntUpdate:", error);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { customLdrmnt } from "@/app/store/matDmd/ldrmntCoSttn";
|
||||
import { ldrmntZod } from "@/app/store/matDmd/ldrmntCoSttn/headList";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { handleCommaNumberChange } from "@/components/lib/func/commom";
|
||||
@@ -14,14 +16,19 @@ export default function SttnDetailModal({
|
||||
}: {
|
||||
formObj: any;
|
||||
}) {
|
||||
const { ldrmntUpdate } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const defaultValues: z.infer<typeof ldrmntZod> = ldrmntZod.parse({});
|
||||
const form = useForm<z.infer<typeof ldrmntZod>>({
|
||||
resolver: zodResolver(ldrmntZod),
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const onSubmit = (values: z.infer<typeof ldrmntZod>) => {
|
||||
const onSubmit = (values: customLdrmnt) => {
|
||||
console.log("values", values)
|
||||
if (values)
|
||||
ldrmntUpdate(values)
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user