Give more info on the search json

This commit is contained in:
Las Zenow 2014-08-30 18:22:48 -05:00
parent 23e7866ba9
commit 9f2ac754ac

View file

@ -164,7 +164,12 @@ func searchJson(data interface{}) ([]byte, error) {
for i, book := range search.Books {
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{} {