Give more info on the search json
This commit is contained in:
parent
23e7866ba9
commit
9f2ac754ac
1 changed files with 6 additions and 1 deletions
|
@ -164,7 +164,12 @@ func searchJson(data interface{}) ([]byte, error) {
|
||||||
for i, book := range search.Books {
|
for i, book := range search.Books {
|
||||||
books[i] = bookJsonRaw(book)
|
books[i] = bookJsonRaw(book)
|
||||||
}
|
}
|
||||||
return json.Marshal(books)
|
return json.Marshal(map[string]interface{}{
|
||||||
|
"found": search.Found,
|
||||||
|
"page": search.Page - 1,
|
||||||
|
"items": search.ItemsPage,
|
||||||
|
"books": books,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func bookJsonRaw(book database.Book) map[string]interface{} {
|
func bookJsonRaw(book database.Book) map[string]interface{} {
|
||||||
|
|
Reference in a new issue