diff options
Diffstat (limited to 'api/whois/whois.go')
-rw-r--r-- | api/whois/whois.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/api/whois/whois.go b/api/whois/whois.go index a30661d..cea7326 100644 --- a/api/whois/whois.go +++ b/api/whois/whois.go @@ -26,3 +26,17 @@ func FetchLatestName(context *types.RequestContext, req *http.Request, resp http return success(context, req, resp) } } + + +func ListUpdates(context *types.RequestContext, req *http.Request, resp http.ResponseWriter) types.ContinuationChain { + return func(success types.Continuation, failure types.Continuation) types.ContinuationChain { + updates, err := database.ListUpdates(context.DBConn, database.ListUpdatesQuery{Limit: 25}) + if err != nil { + log.Printf("err fetching updates %s", err) + resp.WriteHeader(http.StatusInternalServerError) + return failure(context, req, resp) + } + (*context.TemplateData)["Updates"] = updates + return success(context, req, resp) + } +} |