This commit is contained in:
parent
48a01ac744
commit
02a8ec95a9
|
|
@ -282,6 +282,38 @@ const CustomQueryExecutorCard = ({
|
|||
}
|
||||
};
|
||||
|
||||
const markAsPart_A = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
};
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/markAsPartA`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
}
|
||||
);
|
||||
setIsLoading(false);
|
||||
const responseData = await response.json();
|
||||
if (responseData.status === "success") {
|
||||
const updatedData = { ...dataValue, is_cover: 1 };
|
||||
// console.log("Data ===== ", updatedData);
|
||||
setDataValue(updatedData);
|
||||
console.log("Updation successfull ....");
|
||||
// toast.success("Record Marked As Ev !...");
|
||||
} else {
|
||||
throw new Error(responseData?.message);
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
};
|
||||
|
||||
const markAsDummy = async () => {
|
||||
const payload = {
|
||||
data,
|
||||
|
|
@ -335,6 +367,7 @@ const CustomQueryExecutorCard = ({
|
|||
{ btnLabel: "Mark As Back", action: updateBack },
|
||||
{ btnLabel: "Mark As Ev", action: updateEvCover },
|
||||
{ btnLabel: "Mark As Dummy", action: markAsDummy },
|
||||
{btnLabel: "Mark As Part-A", action: markAsPart_A},
|
||||
{ btnLabel: "Edit", action: showContainerAction },
|
||||
],
|
||||
PartA: [
|
||||
|
|
|
|||
Loading…
Reference in New Issue