Fixed a bug where toggling between choosing and adding a new publisher would not work
the build failed Details

This commit is contained in:
kolaente 2017-12-05 14:23:56 +01:00
parent 19932ca7e4
commit f93fc3aa84
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 5 deletions

View File

@ -48,7 +48,7 @@
<div class="field" v-if="addPublisherForm"> <div class="field" v-if="addPublisherForm">
<label v-lang.publishers.newPublisher></label> <label v-lang.publishers.newPublisher></label>
<a class="ui green icon button add-publisher-btn" @click="toggleAddPublisher()"><i class="list icon"></i></a> <a class="ui green icon button add-publisher-btn" @click="toggleAddPublisher()"><i class="list icon"></i></a>
<input name="name" :placeholder="langPublishers.newPublisher" type="text" v-model="book.Publisher.name" class="add-publisher"> <input name="name" :placeholder="langPublishers.newPublisher" type="text" v-model="book.publisher.name" class="add-publisher">
</div> </div>
<div class="field"> <div class="field">
@ -164,7 +164,6 @@
if (this.book.authors === null) { if (this.book.authors === null) {
this.book.authors = [] this.book.authors = []
} }
console.log(this.book.authors)
}) })
.catch(e => { .catch(e => {
this.errorNotification(e) this.errorNotification(e)
@ -248,15 +247,12 @@
// Add all newly created authors to it // Add all newly created authors to it
let as = this.newAuthors let as = this.newAuthors
console.log(this.book, this.newAuthors)
for (const i in as) { for (const i in as) {
this.book.authors.push({ this.book.authors.push({
id: 0, id: 0,
name: as[i] name: as[i]
}) })
} }
console.log(this.book.authors, this.newAuthors)
// Beautify all Authors aka split the names in forename and lastname // Beautify all Authors aka split the names in forename and lastname
for (const i in this.book.authors) { for (const i in this.book.authors) {