Skip to content

Commit 971be28

Browse files
authored
Fix datasource update (#258)
1 parent 9297691 commit 971be28

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.15.1 (October 20th, 2025)
2+
3+
BUG FIXES:
4+
5+
* Fix data source update incorrectly adding the id into the body
6+
17
## 2.15.0 (August 28th, 2025)
28

39
FEATURES:

rest/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
const (
16-
clientVersion = "2.15.0"
16+
clientVersion = "2.15.1"
1717

1818
defaultBase = "https://api.nsone.net"
1919
defaultEndpoint = defaultBase + "/v1/"

rest/data_source.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func (s *DataSourcesService) Create(ds *data.Source) (*http.Response, error) {
7272
// NS1 API docs: https://ns1.com/api/#sources-post
7373
func (s *DataSourcesService) Update(ds *data.Source) (*http.Response, error) {
7474
path := fmt.Sprintf("data/sources/%s", ds.ID)
75+
// must be omitted from the body
76+
ds.ID = ""
7577

7678
req, err := s.client.NewRequest("POST", path, &ds)
7779
if err != nil {

0 commit comments

Comments
 (0)