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

@@ -13,14 +13,14 @@ import (
"github.com/stretchr/testify/assert"
)
func testGetbooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, url string) dto.BookUserGet {
func testGetbooksHandler(t *testing.T, router *gin.Engine, userToken string, expectedCode int, url string) dto.BookItemsGet {
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", userToken))
w := httptest.NewRecorder()
router.ServeHTTP(w, req)
var parsedResponse dto.BookUserGet
var parsedResponse dto.BookItemsGet
err := json.Unmarshal(w.Body.Bytes(), &parsedResponse)
if err != nil {
t.Error(err)