summaryrefslogtreecommitdiff
path: root/api/dns.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/dns.go')
-rw-r--r--api/dns.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/api/dns.go b/api/dns.go
new file mode 100644
index 0000000..3105f91
--- /dev/null
+++ b/api/dns.go
@@ -0,0 +1,23 @@
+package api
+
+import (
+ "log"
+ "net/http"
+
+ "git.hatecomputers.club/hatecomputers/hatecomputers.club/database"
+)
+
+func ListDNSRecordsContinuation(context *RequestContext, req *http.Request, resp http.ResponseWriter) ContinuationChain {
+ return func(success Continuation, failure Continuation) ContinuationChain {
+ dnsRecords, err := database.GetUserDNSRecords(context.DBConn, context.User.ID)
+ if err != nil {
+ log.Println(err)
+ resp.WriteHeader(http.StatusInternalServerError)
+ return failure(context, req, resp)
+ }
+
+ (*context.TemplateData)["DNSRecords"] = dnsRecords
+
+ return success(context, req, resp)
+ }
+}