From 2736c307ea05228d666364bf7c27b35fb8f303ed Mon Sep 17 00:00:00 2001 From: appkins Date: Sat, 13 Jul 2024 07:13:49 -0500 Subject: [PATCH] Update dns list --- fields/api.go.tmpl | 2 +- unifi/dns_record.generated.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fields/api.go.tmpl b/fields/api.go.tmpl index 47c9a7f..9d866ac 100644 --- a/fields/api.go.tmpl +++ b/fields/api.go.tmpl @@ -73,7 +73,7 @@ func (c *Client) list{{ .StructName }}(ctx context.Context, site string) ([]{{ . Data []{{ .StructName }} `json:"data"` } - err := c.do(ctx, "GET", fmt.Sprintf("s/%s/{{ if eq .StructName "Device" }}stat/{{ else if $apiVersion2 }}{{ else }}rest/{{ end }}{{ .ResourcePath }}", site), nil, &respBody) + err := c.do(ctx, "GET", fmt.Sprintf("{{ if eq .StructName "DNSRecord" }}%s/site/%s/{{ .ResourcePath }}", c.apiV2Path{{ else }}s/%s/{{ if eq .StructName "Device" }}stat/{{ else if $apiVersion2 }}{{ else }}rest/{{ end }}{{ .ResourcePath }}"{{ end }}, site), nil, &respBody) if err != nil { return nil, err } diff --git a/unifi/dns_record.generated.go b/unifi/dns_record.generated.go index 0fcb8ba..a96d831 100644 --- a/unifi/dns_record.generated.go +++ b/unifi/dns_record.generated.go @@ -64,7 +64,7 @@ func (c *Client) listDNSRecord(ctx context.Context, site string) ([]DNSRecord, e Data []DNSRecord `json:"data"` } - err := c.do(ctx, "GET", fmt.Sprintf("s/%s/static-dns", site), nil, &respBody) + err := c.do(ctx, "GET", fmt.Sprintf("%s/site/%s/static-dns", c.apiV2Path, site), nil, &respBody) if err != nil { return nil, err }