From 57eabf625ca91c25bf2397dd22b35fb35becefa3 Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 19 Dec 2017 12:10:14 +0100 Subject: [PATCH] Fixed adding/editing books/authors/publishers/items --- frontend/src/components/AuthorsAddEdit.vue | 7 +++++-- frontend/src/components/BooksAddEdit.vue | 4 ++-- frontend/src/components/ItemsAddEdit.vue | 4 ++-- frontend/src/components/PublishersAddEdit.vue | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/AuthorsAddEdit.vue b/frontend/src/components/AuthorsAddEdit.vue index 06bfb35..5b5a8f5 100644 --- a/frontend/src/components/AuthorsAddEdit.vue +++ b/frontend/src/components/AuthorsAddEdit.vue @@ -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 diff --git a/frontend/src/components/BooksAddEdit.vue b/frontend/src/components/BooksAddEdit.vue index b5e4ca3..6410766 100644 --- a/frontend/src/components/BooksAddEdit.vue +++ b/frontend/src/components/BooksAddEdit.vue @@ -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 diff --git a/frontend/src/components/ItemsAddEdit.vue b/frontend/src/components/ItemsAddEdit.vue index ce56528..1fada65 100644 --- a/frontend/src/components/ItemsAddEdit.vue +++ b/frontend/src/components/ItemsAddEdit.vue @@ -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 diff --git a/frontend/src/components/PublishersAddEdit.vue b/frontend/src/components/PublishersAddEdit.vue index 29c8908..2b32349 100644 --- a/frontend/src/components/PublishersAddEdit.vue +++ b/frontend/src/components/PublishersAddEdit.vue @@ -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