From 3ce1f58a4876a1a1338f64b8b588e94f05431993 Mon Sep 17 00:00:00 2001 From: Howl Date: Fri, 28 Oct 2016 16:45:30 +0200 Subject: [PATCH] add pagination to GET /tokens --- app/v1/token.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/v1/token.go b/app/v1/token.go index d22e6cf..8064c6a 100644 --- a/app/v1/token.go +++ b/app/v1/token.go @@ -187,7 +187,8 @@ func TokenSelfGET(md common.MethodData) common.CodeMessager { } var r tokenSingleResponse // md.User.ID = token id, userid would have been md.User.UserID. what a clusterfuck - err := md.DB.QueryRow("SELECT id, privileges, description FROM tokens WHERE id = ?", md.User.ID).Scan( + err := md.DB.QueryRow("SELECT id, privileges, description FROM tokens WHERE id = ? "+ + common.Paginate(md.Query("p"), md.Query("l"), 50), md.User.ID).Scan( &r.ID, &r.Privileges, &r.Description, ) if err != nil {