From 1448b1a6dd02ea702186270f95ecb2ec42cf804a Mon Sep 17 00:00:00 2001 From: Alexandre Oliveira Date: Sat, 28 Nov 2020 13:12:39 +0100 Subject: [PATCH] Change the ID of the record added to the ID returned by the API --- client.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client.go b/client.go index bb977ce..8365aff 100644 --- a/client.go +++ b/client.go @@ -76,18 +76,15 @@ func (p *Provider) addDNSRecord(ctx context.Context, domain string, record libdn Data: strconv.Quote(record.Value), TTL: int(record.TTL.Seconds()), } + rec, err := p.client.vultr.DomainRecord.Create(ctx, domain, domainRecordReq) if err != nil { return record, err } - return libdns.Record{ - Name: rec.Name, - Type: rec.Type, - Value: rec.Data, - TTL: time.Duration(rec.TTL) * time.Second, - ID: rec.ID, - }, nil + record.ID = rec.ID + + return record, nil } func (p *Provider) removeDNSRecord(ctx context.Context, domain string, record libdns.Record) (libdns.Record, error) {