Skip to content

Instantly share code, notes, and snippets.

@stevepop
Created February 1, 2021 15:34
Show Gist options
  • Select an option

  • Save stevepop/d595bbb33a7f97fbb6e8e0019b0876b1 to your computer and use it in GitHub Desktop.

Select an option

Save stevepop/d595bbb33a7f97fbb6e8e0019b0876b1 to your computer and use it in GitHub Desktop.

Revisions

  1. stevepop created this gist Feb 1, 2021.
    15 changes: 15 additions & 0 deletions updateMedication.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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')
    }
    })
    }