From de2188f1a6bf6574b7f1fdcbe21c25ff84defbdf Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 28 Jan 2018 16:22:03 -0600 Subject: [PATCH] rename loc in response to locator --- app/rest/admin.go | 2 +- app/rest/server.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/rest/admin.go b/app/rest/admin.go index 81faa18e..013540ed 100644 --- a/app/rest/admin.go +++ b/app/rest/admin.go @@ -79,7 +79,7 @@ func (a *admin) setPinCtrl(w http.ResponseWriter, r *http.Request) { return } a.cache.Flush() - render.JSON(w, r, JSON{"id": commentID, "loc": locator, "pin": pinStatus}) + render.JSON(w, r, JSON{"id": commentID, "locator": locator, "pin": pinStatus}) } // GET /export?site=site-id?mode=file|stream diff --git a/app/rest/server.go b/app/rest/server.go index 9717fe33..2dfdd6aa 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -159,7 +159,7 @@ func (s *Server) createCommentCtrl(w http.ResponseWriter, r *http.Request) { s.Cache.Flush() // reset all caches render.Status(r, http.StatusCreated) - render.JSON(w, r, JSON{"id": id, "loc": comment.Locator}) + render.JSON(w, r, JSON{"id": id, "locator": comment.Locator}) } // PUT /comment/{id}?site=siteID&url=post-url - update comment @@ -330,7 +330,7 @@ func (s *Server) countCtrl(w http.ResponseWriter, r *http.Request) { common.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't get count") return } - render.JSON(w, r, JSON{"count": count, "loc": locator}) + render.JSON(w, r, JSON{"count": count, "locator": locator}) } // GET /list?site=siteID - list posts with comments