Fixes to date validation logic in item submission form.

This commit is contained in:
mateuswetah 2024-09-10 11:14:36 -03:00
parent b12849abde
commit 3e986f0ccd
3 changed files with 5 additions and 8 deletions

View File

@ -72,11 +72,8 @@
if (dateISO == false) { if (dateISO == false) {
if ( !this.isOnItemSubmissionForm ) this.dateValue = $event.target.value; // Keep wrong version in the input so user can fix it
this.dateValue = $event.target.value; // Keep wrong version in the input so user can fix it
else
this.$emit('update:value', this.dateValue) // On item submission we send the errored version here to allow the server to return the correct format.
this.isInvalidDate = true; this.isInvalidDate = true;
return; return;

View File

@ -407,8 +407,8 @@ export const finishItemSubmission = ({ commit }, { itemSubmission, fakeItemId })
resolve( res.data ); resolve( res.data );
}).catch( error => { }).catch( error => {
reject({ reject({
errors: error.response.data.errors, errors: error.error.response.data.errors,
error_message: error.response.data.error_message error_message: error.error.response.data.error_message
}); });
}); });
}); });

View File

@ -1053,7 +1053,7 @@ export default {
} }
} }
this.formErrorMessage = errors.error_message; this.formErrorMessage = errors.error_message;
this.isSubmitting = false; this.isSubmitting = false;
this.hasSentForm = false; this.hasSentForm = false;
this.isUploading = false; this.isUploading = false;