adding button notification in edit view of a work.

This commit is contained in:
Lucas Silva 2023-04-27 10:59:09 +02:00
parent 67b32341d1
commit 0a2f41c8a0

View File

@ -296,7 +296,13 @@
@go-to-generate-workflow="goToGenerateWorkflow"
></list-workflow-modal>
</li>
<li>
<button
class="btn btn-notify"
@click="goToGenerateNotification"
>
</button>
</li>
<li v-if="!isPosting">
<button class="btn btn-save" @click="submit">
{{ $t('action.save') }}
@ -548,6 +554,15 @@ export default {
return this.$store.dispatch('submit', callback)
.catch(e => { console.log(e); throw e; });
},
goToGenerateNotification() {
console.log('save before leave to notification');
const callback = (data) => {
window.location.assign(`/fr/notification/create?entityClass=Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork&entityId=${this.work.id}&returnPath=/fr/person/accompanying-period/${this.work.accompanyingPeriod.id}/work`);
}
return this.$store.dispatch('submit', callback)
.catch(e => {console.log(e); throw e});
},
submit() {
this.$store.dispatch('submit').catch((error) => {
if (error.name === 'ValidationException' || error.name === 'AccessException') {