Fixes to date validation logic in item submission form.

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

View File

@ -72,11 +72,8 @@
if (dateISO == false) {
if ( !this.isOnItemSubmissionForm )
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.dateValue = $event.target.value; // Keep wrong version in the input so user can fix it
this.isInvalidDate = true;
return;

View File

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

View File

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