From 9ea7ef2e50d009a3d8cfa8c08a77918f4bb00133 Mon Sep 17 00:00:00 2001 From: Arthur Lefebvre Date: Tue, 25 Nov 2025 18:11:27 +0100 Subject: [PATCH] Add author books list --- front/src/AuthorForm.vue | 25 ++++--- front/src/SearchBook.vue | 24 ++++--- front/src/api.js | 9 +++ internal/apitest/get_book_per_author.go | 71 +++++++++++++++++++ internal/apitest/get_count_user_book_test.go | 19 +++++ internal/middleware/auth.go | 4 +- internal/query/search.go | 21 ++++++ internal/routes/authorbooksget.go | 73 ++++++++++++++++++++ internal/setup/setup.go | 6 ++ 9 files changed, 233 insertions(+), 19 deletions(-) create mode 100644 internal/apitest/get_book_per_author.go create mode 100644 internal/routes/authorbooksget.go diff --git a/front/src/AuthorForm.vue b/front/src/AuthorForm.vue index 2b086ca..5c16d82 100644 --- a/front/src/AuthorForm.vue +++ b/front/src/AuthorForm.vue @@ -2,29 +2,38 @@ import { ref } from 'vue' import { getAuthor } from './api.js' import { onBeforeRouteUpdate } from 'vue-router' + import SearchBook from './SearchBook.vue' const props = defineProps({ id: String }); - let data = ref(null); - let error = ref(null); + let author = ref(null); + let authorfetcherror = ref(null); - getAuthor(data, error, props.id); + getAuthor(author, authorfetcherror, props.id); onBeforeRouteUpdate(async (to, from) => { - getAuthor(data, error, to.params.id); + getAuthor(author, authorfetcherror, to.params.id); }) diff --git a/front/src/SearchBook.vue b/front/src/SearchBook.vue index 486336d..7cf8f44 100644 --- a/front/src/SearchBook.vue +++ b/front/src/SearchBook.vue @@ -1,7 +1,7 @@