Use the same widget for books everywhere

This commit is contained in:
2026-03-27 22:08:24 +01:00
parent 726c640657
commit e05c9f2b45
17 changed files with 70 additions and 146 deletions

View File

@@ -60,14 +60,14 @@ func TestGetReadBooksHandler_CheckOneBook(t *testing.T) {
token := testutils.ConnectDemo2User(router)
result := testGetReadBooksHandler(t, router, token, 200, "100", "")
var book dto.BookUserGetBook
var book dto.BookItemGet
for _, b := range result.Books {
if b.Title == "De sang-froid" {
book = b
}
}
assert.Equal(t,
dto.BookUserGetBook{
dto.BookItemGet{
ID: 18,
Title: "De sang-froid",
Author: "Truman Capote",
@@ -77,7 +77,7 @@ func TestGetReadBooksHandler_CheckOneBook(t *testing.T) {
}, book)
}
func testGetReadBooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, limit string, offset string) dto.BookUserGet {
func testGetReadBooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, limit string, offset string) dto.BookItemsGet {
u, err := url.Parse("/ws/mybooks/read")
if err != nil {
t.Error(err)