Skip to content

Instantly share code, notes, and snippets.

@bmease
Created December 23, 2019 23:27
Show Gist options
  • Save bmease/747b94b5a658d5208800d71e9c55445f to your computer and use it in GitHub Desktop.
Save bmease/747b94b5a658d5208800d71e9c55445f to your computer and use it in GitHub Desktop.
async addMediaToGallery({ commit }, { gallery, file }) {
const formData = new FormData()
formData.append('file', file)
const options = {
headers: { 'Content-Type': 'multipart/form-data' }
}
const response = await this.$axios.$post(
`/api/1.0/gallery/${gallery.id}/add-media/`,
formData,
options
)
commit(SET_GALLERY, response)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment