wr: message alert
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
||||
import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form";
|
||||
import type { conCostFeeType, rateFeeType } from "./type";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
|
||||
export const comFcltStateExport: comFcltState = {
|
||||
@@ -59,8 +58,8 @@ export type comFcltState = {
|
||||
type comFcltActions = {
|
||||
getSwtrmtFcltNm: (searchNm: string) => void;
|
||||
getDemandCompList: (searchNm: string, cnt: number) => void;
|
||||
regDemandCompany: (data: DemandCompType) => void;
|
||||
updateDemandCompany: (data: DemandCompType) => void;
|
||||
regDemandCompany: (data: DemandCompType) => Promise<string>;
|
||||
updateDemandCompany: (data: DemandCompType) => Promise<string>;
|
||||
getConstCostFee: (year: string) => void;
|
||||
getRateFee: (year: string) => void;
|
||||
};
|
||||
@@ -109,7 +108,6 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
fetchType.WR
|
||||
);
|
||||
if (response.status === 200) {
|
||||
toast.success('수요처가 등록되었습니다. ')
|
||||
set((state: comFcltState) => {
|
||||
|
||||
return {
|
||||
@@ -117,11 +115,12 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
dmdIsSucees: "success"
|
||||
}
|
||||
});
|
||||
return "수요처가 등록되었습니다.";
|
||||
}
|
||||
return "수요처 등록에 실패하였습니다.";
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
toast.error('수요처가 등록 오류입니다.. ')
|
||||
|
||||
return "수요처 등록 중 오류가 발생했습니다.";
|
||||
}
|
||||
},
|
||||
updateDemandCompany: async (data: DemandCompType) => {
|
||||
@@ -131,7 +130,6 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
let message = "";
|
||||
if (response.status === 200) {
|
||||
message = "success";
|
||||
toast.success('수요처 정보가 변경되었습니다. ' )
|
||||
} else {
|
||||
message = "fail";
|
||||
}
|
||||
@@ -142,10 +140,13 @@ export const comFcltSearchAction: (set: any) => comFcltActions = (set: any) => {
|
||||
dmdIsSucees: message
|
||||
}
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return "수요처 정보가 변경되었습니다.";
|
||||
}
|
||||
return "수요처 정보 변경에 실패하였습니다.";
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
toast.success('수요처 정보가 오류입니다. ' )
|
||||
|
||||
return "수요처 정보 변경 중 오류가 발생했습니다.";
|
||||
}
|
||||
},
|
||||
getRateFee: async (year: string) => {
|
||||
|
||||
Reference in New Issue
Block a user