Skip to content

Commit

Permalink
Cleaner implementation of ID-based adjustments in datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
DRuggeri committed Sep 6, 2018
1 parent f5d6ad4 commit ac5c866
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions restapi/datasource_api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {

obj, err := NewAPIObject (
meta.(*api_client),
path + "/{id}",
path,
path,
path,
path,
path + "/{id}",
path + "/{id}",
d.Id(),
"{}",
debug,
Expand Down Expand Up @@ -145,9 +145,6 @@ func dataSourceRestApiRead(d *schema.ResourceData, meta interface{}) error {
if debug { log.Printf("datasource_api_object.go: Attempting to refresh object information after resetting paths") }
d.SetId(obj.id)
obj.id = id
obj.get_path = obj.get_path + "/" + id
obj.put_path = obj.put_path + "/" + id
obj.delete_path = obj.delete_path + "/" + id

err = obj.read_object()
if err == nil {
Expand Down

0 comments on commit ac5c866

Please sign in to comment.