Fixed the empty params and fixed broken offer link

This commit was merged in pull request #246.
This commit is contained in:
2023-07-04 15:00:00 +01:00
parent fe7d23837c
commit 3de1ef71c9
4 changed files with 75 additions and 14 deletions
+2 -5
View File
@@ -21,6 +21,7 @@ const SuggestTask = ({ details, onClose, situation }) => {
const apiCall = new usersService();
const handleSubmit = async (values) => {
if(!values.title && !values.description) return;
try {
setSubmitTask({ loading: true });
const reqData = { ...values };
@@ -29,8 +30,8 @@ const SuggestTask = ({ details, onClose, situation }) => {
setSubmitTask({ loading: false, msg: res.status, state: "bad" });
return;
}
setSubmitTask({ loading: false, msg: res.status, state: "success" });
setTimeout(() => {
setSubmitTask({ loading: false, msg: res.status, state: "success" });
onClose();
}, 2000);
} catch (error) {
@@ -144,14 +145,10 @@ const SuggestTask = ({ details, onClose, situation }) => {
<span className="text-gradient"> Cancel</span>
</button>
{/* {requestStatus.loading ? (
<LoadingSpinner size="8" color="sky-blue" />
) : ( */}
<button
type="submit"
disabled={props.isSubmitting}
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'
>
{submitTask.loading
? "Submitting Task"