Collection: new widget to add book to collection
This commit is contained in:
@@ -38,7 +38,7 @@ func GetSearchBooksHandler(ac appcontext.AppContext) {
|
||||
return
|
||||
}
|
||||
var returnedBooks dto.BookItemsGet
|
||||
if !params.Inventaire {
|
||||
if params.Inventaire != dto.ForceInventaireSearch {
|
||||
books, err := query.FetchBookSearchGet(ac.Db, user.ID, searchterm, limit, offset)
|
||||
if err != nil {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
@@ -51,7 +51,7 @@ func GetSearchBooksHandler(ac appcontext.AppContext) {
|
||||
}
|
||||
returnedBooks = dto.BookItemsGet{Count: count, Inventaire: false, Books: books}
|
||||
}
|
||||
if params.Inventaire || len(returnedBooks.Books) == 0 {
|
||||
if (params.Inventaire == dto.InventaireIfNothingFound && len(returnedBooks.Books) == 0) || (params.Inventaire == dto.ForceInventaireSearch) {
|
||||
returnedBooksPtr, err := searchInInventaireAPI(ac.Config.InventaireUrl, searchterm, limit, offset, params)
|
||||
if err != nil {
|
||||
myvalidator.ReturnErrorsAsJsonResponse(&ac, err)
|
||||
|
||||
Reference in New Issue
Block a user