Update:Matching authors uses the ASIN if set #572, Fix:Purge author image cache when updating author

This commit is contained in:
advplyr 2022-05-13 18:11:54 -05:00
parent eaa383b6d8
commit f78d287b59
7 changed files with 43 additions and 79 deletions

View file

@ -65,6 +65,9 @@ export default {
name() {
return this._author.name || ''
},
asin() {
return this._author.asin || ''
},
numBooks() {
return this._author.numBooks || 0
},
@ -81,7 +84,11 @@ export default {
},
async searchAuthor() {
this.searching = true
var response = await this.$axios.$post(`/api/authors/${this.authorId}/match`, { q: this.name }).catch((error) => {
const payload = {}
if (this.asin) payload.asin = this.asin
else payload.q = this.name
var response = await this.$axios.$post(`/api/authors/${this.authorId}/match`, payload).catch((error) => {
console.error('Failed', error)
return null
})