New data model update for Match tab

This commit is contained in:
advplyr 2022-03-14 08:12:28 -05:00
parent 7d66f1eec9
commit 7348432594
3 changed files with 45 additions and 15 deletions

View file

@ -169,14 +169,18 @@ export default {
async updateDetails(updatedDetails) {
this.isProcessing = true
console.log('Sending update', updatedDetails.updatePayload)
var updatedAudiobook = await this.$axios.$patch(`/api/items/${this.libraryItemId}/media`, updatedDetails.updatePayload).catch((error) => {
var updateResult = await this.$axios.$patch(`/api/items/${this.libraryItemId}/media`, updatedDetails.updatePayload).catch((error) => {
console.error('Failed to update', error)
return false
})
this.isProcessing = false
if (updatedAudiobook) {
this.$toast.success('Update Successful')
this.$emit('close')
if (updateResult) {
if (updateResult.updated) {
this.$toast.success('Item details updated')
// this.$emit('close')
} else {
this.$toast.info('No updates were necessary')
}
}
},
removeItem() {