Skip to content

Commit ac5c866

Browse files
committed
Cleaner implementation of ID-based adjustments in datasource
1 parent f5d6ad4 commit ac5c866

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

restapi/datasource_api_object.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {
5959

6060
obj, err := NewAPIObject (
6161
meta.(*api_client),
62+
path + "/{id}",
6263
path,
63-
path,
64-
path,
65-
path,
64+
path + "/{id}",
65+
path + "/{id}",
6666
d.Id(),
6767
"{}",
6868
debug,
@@ -145,9 +145,6 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {
145145
if debug { log.Printf("datasource_api_object.go: Attempting to refresh object information after resetting paths") }
146146
d.SetId(obj.id)
147147
obj.id = id
148-
obj.get_path = obj.get_path + "/" + id
149-
obj.put_path = obj.put_path + "/" + id
150-
obj.delete_path = obj.delete_path + "/" + id
151148

152149
err = obj.read_object()
153150
if err == nil {

0 commit comments

Comments
 (0)