.
This commit is contained in:
@@ -18,7 +18,7 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
||||
description: details?.description || "",
|
||||
};
|
||||
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
const apiCall = new usersService();
|
||||
|
||||
const handleSubmit = async (values) => {
|
||||
try {
|
||||
@@ -34,7 +34,7 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
||||
onClose();
|
||||
}, 2000);
|
||||
} catch (error) {
|
||||
setSubmitTask({ loading: false, msg: error, state: "bad" });
|
||||
setSubmitTask({ loading: false, msg: error, state: "bad" });
|
||||
throw new Error("Error Occurred", error);
|
||||
}
|
||||
};
|
||||
@@ -153,7 +153,13 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
||||
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full"
|
||||
// className='w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'
|
||||
>
|
||||
Send to Parents
|
||||
{submitTask.loading
|
||||
? "Submitting Task"
|
||||
: submitTask.state == "success"
|
||||
? "Task Submitted"
|
||||
: submitTask.state == "bad"
|
||||
? "Error occurred"
|
||||
: "Send to Parents"}
|
||||
</button>
|
||||
{/* )} */}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user