From 5f0b89e9dc9045fd7b9324f72351af4f47e03d2f Mon Sep 17 00:00:00 2001 From: Brett Demetris Date: Thu, 7 May 2020 13:08:30 -0700 Subject: [PATCH] correctly handle the response object for remove profile (#666) --- dep/profile.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dep/profile.go b/dep/profile.go index 0831cc17..485d62fe 100644 --- a/dep/profile.go +++ b/dep/profile.go @@ -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") }