Skip to content

Instantly share code, notes, and snippets.

@stevepop
Created February 1, 2021 15:34
Show Gist options
  • Save stevepop/d595bbb33a7f97fbb6e8e0019b0876b1 to your computer and use it in GitHub Desktop.
Save stevepop/d595bbb33a7f97fbb6e8e0019b0876b1 to your computer and use it in GitHub Desktop.
updateQuantity(updateAction) {
this.sending = true
this.form.action = updateAction
this.$inertia.put(this.route('medication-inventories.update', {
'medication_inventory': this.medication.id
}), this.form, {
onSuccess: () => {
this.form.action === 'add' ? this.modalShowing = false: this.destroyModalShowing = false
this.sending = false
},
onError: () => {
console.log('There was an error')
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment