Add position for book in collection
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"git.artlef.fr/bibliomane/internal/adapter"
|
||||
"git.artlef.fr/bibliomane/internal/appcontext"
|
||||
"git.artlef.fr/bibliomane/internal/dto"
|
||||
"git.artlef.fr/bibliomane/internal/i18nresource"
|
||||
@@ -50,12 +51,13 @@ func GetCollectionHandler(ac appcontext.AppContext) {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
return
|
||||
}
|
||||
books, err := query.FetchCollectionBooks(ac.Db, user.ID, uint(collectionId), limit, offset)
|
||||
itemsQueryResult, err := query.FetchCollectionItems(ac.Db, user.ID, uint(collectionId), limit, offset)
|
||||
if err != nil {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
return
|
||||
}
|
||||
collection.Books = books
|
||||
items := adapter.CollectionItemsQueryToDto(itemsQueryResult)
|
||||
collection.Items = items
|
||||
count, err := query.FetchCollectionBooksCount(ac.Db, user.ID, uint(collectionId))
|
||||
if err != nil {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
|
||||
Reference in New Issue
Block a user