I'm a beginner to code and with my group we have to do an online quote manager module. We work in next.js. Until then, everything is going well but with my partner we're working on saving quotes that can be modified before being submitted. We're not sure how to handle the code. Our quotes are in "to do" and not in "draft" For the moment we only succeed in submitting requests for quotes but not the modification.
Thanks in advance !
const handleClickSave = async (data) => {
console.log(data);
axios
.post("./api/estimate/estimateApi", { ...data, status: "DRAFT" })
.then((res) => {
Swal.fire({
position: "center",
icon: "success",
title:
"Votre demande de devis a été enregistré mais n'a pas été envoyé à l'administrateur",
showConfirmButton: false,
timer: 2500,
});
});
};
The edit button :
<button
className="bg-third w-2/5 h-10 flex justify-center rounded-3xl m-20 p-2 text-ml"
onClick={handleClickSave}
type="button"
name="Save"
>
Enregistrer ma demande pour continuer plus tard <br />
<SaveIcon className="ml-10" />
</button>