From c9677385f8f206716663d8811e8a419351693bf9 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Mon, 18 Feb 2019 16:58:55 -0500 Subject: [PATCH] commenter_self.go: include email details --- api/commenter_self.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/commenter_self.go b/api/commenter_self.go index 23a0d7a..6cb1409 100644 --- a/api/commenter_self.go +++ b/api/commenter_self.go @@ -21,5 +21,11 @@ func commenterSelfHandler(w http.ResponseWriter, r *http.Request) { return } - bodyMarshal(w, response{"success": true, "commenter": c}) + e, err := emailGet(c.Email) + if err != nil { + bodyMarshal(w, response{"success": false, "message": err.Error()}) + return + } + + bodyMarshal(w, response{"success": true, "commenter": c, "email": e}) }