Refactor: make only one API route to update userbooks

This commit is contained in:
2026-03-12 16:58:59 +01:00
parent f32bb49972
commit d07f18d380
11 changed files with 279 additions and 390 deletions

View File

@@ -12,7 +12,6 @@ import (
"git.artlef.fr/bibliomane/internal/config"
"git.artlef.fr/bibliomane/internal/setup"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
)
func TestSetup() *gin.Engine {
@@ -62,5 +61,7 @@ func TestBookPutCallWithDemoPayload(t *testing.T, payload string, bookId string,
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token))
w := httptest.NewRecorder()
router.ServeHTTP(w, req)
assert.Equal(t, expectedCode, w.Code)
if w.Code != expectedCode {
t.Errorf("%s", w.Body.String())
}
}