diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-27 22:55:22 -0600 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-27 22:55:22 -0600 |
| commit | 75ba836d6072235fc7a71659f8630ab3c1b210ad (patch) | |
| tree | 386b65ae6d7a4215c2f7b4944fc2f0922d162491 /api/dns.go | |
| parent | b2fa4fe9454cbc9c9c0e265e3e6065eaa8726e2f (diff) | |
| download | hatecomputers.club-75ba836d6072235fc7a71659f8630ab3c1b210ad.tar.gz hatecomputers.club-75ba836d6072235fc7a71659f8630ab3c1b210ad.zip | |
add dns form
Diffstat (limited to 'api/dns.go')
| -rw-r--r-- | api/dns.go | 23 |
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) + } +} |
