fix: a lot a fixes and validation improvements on Pricing; Schedule; AdditionalContacts and Delegate

This commit is contained in:
Matthieu Bessat 2020-08-04 22:51:18 +02:00
parent ee02257362
commit dc3aaa22c0
6 changed files with 171 additions and 106 deletions

View file

@ -362,26 +362,6 @@ export default {
return new Promise((resolve, reject) => {
this.isSaving = true
const data = this.$store.state.data
data.pricing = data.pricing.map(i => {
delete i._id
return i
})
data.schedule = data.schedule.map(i => {
delete i._id
if (Array.isArray(i.when) && i.when.length > 0) {
i.when = i.when.map(w => {
delete w._id
return w
})
}
return i
})
if (Array.isArray(data.contacts.peoples)) {
data.contacts.peoples = data.contacts.peoples.map(p => {
delete p._id
return p
})
}
this.$apitator.put('/delegate', data, { withAuth: true }).then(() => {
this.isSaving = false
if (showSuccessAlert) {