From 9f2ac754ac7074414a2ca2f71662d9776b74ad5c Mon Sep 17 00:00:00 2001 From: Las Zenow Date: Sat, 30 Aug 2014 18:22:48 -0500 Subject: [PATCH] Give more info on the search json --- template.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/template.go b/template.go index cffe764..4e9225c 100644 --- a/template.go +++ b/template.go @@ -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{} {