chain supermarket create/update to include categories

This commit is contained in:
smilerz
2021-09-27 17:55:58 -05:00
parent 1d983d7310
commit c1a22ea2a6
14 changed files with 101 additions and 62 deletions

View File

@@ -237,6 +237,7 @@ export default {
case this.Actions.UPDATE:
update = e.form_data
update.id = this.this_item.id
console.log('form', update)
this.saveThis(update)
break;
case this.Actions.MERGE:
@@ -285,11 +286,7 @@ export default {
})
} else {
this.genericAPI(this.this_model, this.Actions.UPDATE, thisItem).then((result) => {
// using form data to refresh the card
// when there are complicated functions (SuperMarket Relations) the actions don't
// always complete first. TODO: wrap all that in a Promise and wait for it to complete before using refreshThis instead
this.refreshCard(thisItem, this.items_left)
this.refreshCard({...thisItem}, this.items_right)
this.refreshThis(thisItem.id)
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE)
}).catch((err) => {
console.log(err, err.response)