Create new records

This commit is contained in:
Magnus Åhall 2026-02-25 14:48:11 +01:00
parent 7d7c0c9570
commit 3763367510
6 changed files with 117 additions and 19 deletions

View file

@ -101,13 +101,15 @@ func actionRecordSave(w http.ResponseWriter, r *http.Request) {
return
}
err = device.UpdateDNSEntry(record.toDNSEntry())
entry, err := device.UpdateDNSEntry(record.toDNSEntry())
if err != nil {
httpError(w, err)
logger.Error("webserver", "op", "record_save", "error", err)
return
}
j, _ := json.Marshal(struct{ OK bool }{true})
record = NewDNSRecord(entry)
j, _ := json.Marshal(struct{ OK bool; Record DNSRecord }{true, record})
w.Write(j)
}