correctly handle the response object for remove profile (#666)

This commit is contained in:
Brett Demetris
2020-05-07 13:08:30 -07:00
committed by GitHub
parent 39230bbdfe
commit 5f0b89e9dc

View File

@@ -79,7 +79,9 @@ func (c *Client) FetchProfile(uuid string) (*Profile, error) {
}
func (c *Client) RemoveProfile(serials ...string) (map[string]string, error) {
var response map[string]string
var response struct {
Devices map[string]string `json:"devices"`
}
var request = struct {
Devices []string `json:"devices"`
}{Devices: serials}
@@ -89,5 +91,5 @@ func (c *Client) RemoveProfile(serials ...string) (map[string]string, error) {
return nil, errors.Wrap(err, "create fetch profile request")
}
err = c.do(req, &response)
return response, errors.Wrap(err, "remove profile")
return response.Devices, errors.Wrap(err, "remove profile")
}