Fixed adding/editing books/authors/publishers/items

This commit is contained in:
konrad 2017-12-19 12:10:14 +01:00 committed by kolaente
parent 24ec279fd5
commit 57eabf625c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 11 additions and 8 deletions

View File

@ -65,6 +65,9 @@
computed: {
langAuthors () {
return this.translate('authors')
},
langGeneral () {
return this.translate('general')
}
},
methods: {
@ -95,7 +98,7 @@
// Finally Send it
// If we want to newly insert it, make a different request
if (this.edit) {
HTTP.post('authors/' + this.author.id, {author: this.author})
HTTP.post('authors/' + this.author.id, this.author)
.then(response => {
this.loading = false
@ -114,7 +117,7 @@
this.errorNotification(e)
})
} else { // insert a new author
HTTP.put('authors', {author: this.author})
HTTP.put('authors', this.author)
.then(response => {
this.loading = false

View File

@ -288,7 +288,7 @@
// Finally Send it
// If we want to newly insert it, make a different request
if (this.edit) {
HTTP.post('books/' + this.book.id, {book: this.book})
HTTP.post('books/' + this.book.id, this.book)
.then(response => {
this.loading = false
@ -307,7 +307,7 @@
this.errorNotification(e)
})
} else { // insert a new book
HTTP.put('books', {book: this.book})
HTTP.put('books', this.book)
.then(response => {
this.loading = false
// Fire a notification

View File

@ -109,7 +109,7 @@
// Finally Send it
// If we want to newly insert it, make a different request
if (this.edit) {
HTTP.post('items/' + this.item.id, {item: this.item})
HTTP.post('items/' + this.item.id, this.item)
.then(response => {
this.loading = false
@ -128,7 +128,7 @@
this.errorNotification(e)
})
} else { // insert a new item
HTTP.put('items', {item: this.item})
HTTP.put('items', this.item)
.then(response => {
this.loading = false

View File

@ -89,7 +89,7 @@
// Finally Send it
// If we want to newly insert it, make a different request
if (this.edit) {
HTTP.post('publishers/' + this.publisher.id, {publisher: this.publisher})
HTTP.post('publishers/' + this.publisher.id, this.publisher)
.then(response => {
this.loading = false
@ -108,7 +108,7 @@
this.errorNotification(e)
})
} else { // insert a new publisher
HTTP.put('publishers', {publisher: this.publisher})
HTTP.put('publishers', this.publisher)
.then(response => {
this.loading = false