Fixed adding/editing books/authors/publishers/items
This commit is contained in:
parent
24ec279fd5
commit
57eabf625c
|
@ -65,6 +65,9 @@
|
||||||
computed: {
|
computed: {
|
||||||
langAuthors () {
|
langAuthors () {
|
||||||
return this.translate('authors')
|
return this.translate('authors')
|
||||||
|
},
|
||||||
|
langGeneral () {
|
||||||
|
return this.translate('general')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -95,7 +98,7 @@
|
||||||
// Finally Send it
|
// Finally Send it
|
||||||
// If we want to newly insert it, make a different request
|
// If we want to newly insert it, make a different request
|
||||||
if (this.edit) {
|
if (this.edit) {
|
||||||
HTTP.post('authors/' + this.author.id, {author: this.author})
|
HTTP.post('authors/' + this.author.id, this.author)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
@ -114,7 +117,7 @@
|
||||||
this.errorNotification(e)
|
this.errorNotification(e)
|
||||||
})
|
})
|
||||||
} else { // insert a new author
|
} else { // insert a new author
|
||||||
HTTP.put('authors', {author: this.author})
|
HTTP.put('authors', this.author)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
|
|
@ -288,7 +288,7 @@
|
||||||
// Finally Send it
|
// Finally Send it
|
||||||
// If we want to newly insert it, make a different request
|
// If we want to newly insert it, make a different request
|
||||||
if (this.edit) {
|
if (this.edit) {
|
||||||
HTTP.post('books/' + this.book.id, {book: this.book})
|
HTTP.post('books/' + this.book.id, this.book)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@
|
||||||
this.errorNotification(e)
|
this.errorNotification(e)
|
||||||
})
|
})
|
||||||
} else { // insert a new book
|
} else { // insert a new book
|
||||||
HTTP.put('books', {book: this.book})
|
HTTP.put('books', this.book)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
// Fire a notification
|
// Fire a notification
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
// Finally Send it
|
// Finally Send it
|
||||||
// If we want to newly insert it, make a different request
|
// If we want to newly insert it, make a different request
|
||||||
if (this.edit) {
|
if (this.edit) {
|
||||||
HTTP.post('items/' + this.item.id, {item: this.item})
|
HTTP.post('items/' + this.item.id, this.item)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
this.errorNotification(e)
|
this.errorNotification(e)
|
||||||
})
|
})
|
||||||
} else { // insert a new item
|
} else { // insert a new item
|
||||||
HTTP.put('items', {item: this.item})
|
HTTP.put('items', this.item)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
// Finally Send it
|
// Finally Send it
|
||||||
// If we want to newly insert it, make a different request
|
// If we want to newly insert it, make a different request
|
||||||
if (this.edit) {
|
if (this.edit) {
|
||||||
HTTP.post('publishers/' + this.publisher.id, {publisher: this.publisher})
|
HTTP.post('publishers/' + this.publisher.id, this.publisher)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
this.errorNotification(e)
|
this.errorNotification(e)
|
||||||
})
|
})
|
||||||
} else { // insert a new publisher
|
} else { // insert a new publisher
|
||||||
HTTP.put('publishers', {publisher: this.publisher})
|
HTTP.put('publishers', this.publisher)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue