mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-07 18:15:47 +08:00
correctly handle the response object for remove profile (#666)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user