Set d.Key for all settings updates

This commit is contained in:
Kurt McAlpine
2021-04-06 10:48:56 +12:00
committed by Paul Tyng
parent ac8d0c5659
commit bd8898db77
32 changed files with 157 additions and 1 deletions

View File

@@ -153,6 +153,7 @@ func (c *Client) update{{ .StructName }}(ctx context.Context, site string, d *{{
Data []{{ .StructName }} `json:"data"`
}
{{ if .IsSetting }}
d.Key = "{{ .ResourcePath }}"
err := c.do(ctx, "PUT", fmt.Sprintf("s/%s/set/setting/{{ .ResourcePath }}", site), d, &respBody)
{{- else }}
err := c.do(ctx, "PUT", fmt.Sprintf("s/%s/rest/{{ .ResourcePath }}/%s", site, d.ID), d, &respBody)