add person: increase z-index of toast and wait for validation before closing modal

This commit is contained in:
nobohan
2022-01-17 12:17:22 +01:00
parent 7af4c3434e
commit db65134743
3 changed files with 26 additions and 6 deletions

View File

@@ -66,9 +66,10 @@
<div class="create-button">
<on-the-fly
v-if="query.length >= 3"
v-bind:buttonText="$t('onthefly.create.button', {q: query})"
:buttonText="$t('onthefly.create.button', {q: query})"
action="create"
@saveFormOnTheFly="saveFormOnTheFly">
@saveFormOnTheFly="saveFormOnTheFly"
:canCloseModal="canCloseOnTheFlyModal">
</on-the-fly>
</div>
@@ -119,7 +120,8 @@ export default {
suggested: [],
selected: [],
priorSuggestion: {}
}
},
canCloseOnTheFlyModal: false
}
},
computed: {
@@ -269,6 +271,7 @@ export default {
makeFetch('POST', '/api/1.0/person/person.json', data)
.then(response => {
this.newPriorSuggestion(response);
this.canCloseOnTheFlyModal = true;
})
.catch((error) => {
if (error.name === 'ValidationException') {
@@ -284,6 +287,7 @@ export default {
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
.then(response => {
this.newPriorSuggestion(response);
this.canCloseOnTheFlyModal = true;
})
.catch((error) => {
if (error.name === 'ValidationException') {