[MM-28218] API hookup for updating company info and address in MM app (#15974)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c05ee81c9f
Коммит
73a1c95137
@@ -5686,3 +5686,33 @@ func (c *Client4) GetSubscription() (*Subscription, *Response) {
|
||||
|
||||
return subscription, BuildResponse(r)
|
||||
}
|
||||
|
||||
func (c *Client4) UpdateCloudCustomer(customerInfo *CloudCustomerInfo) (*CloudCustomer, *Response) {
|
||||
customerBytes, _ := json.Marshal(customerInfo)
|
||||
|
||||
r, appErr := c.doApiPutBytes(c.GetCloudRoute()+"/customer", customerBytes)
|
||||
if appErr != nil {
|
||||
return nil, BuildErrorResponse(r, appErr)
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var customer *CloudCustomer
|
||||
json.NewDecoder(r.Body).Decode(&customer)
|
||||
|
||||
return customer, BuildResponse(r)
|
||||
}
|
||||
|
||||
func (c *Client4) UpdateCloudCustomerAddress(address *Address) (*CloudCustomer, *Response) {
|
||||
addressBytes, _ := json.Marshal(address)
|
||||
|
||||
r, appErr := c.doApiPutBytes(c.GetCloudRoute()+"/customer/address", addressBytes)
|
||||
if appErr != nil {
|
||||
return nil, BuildErrorResponse(r, appErr)
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var customer *CloudCustomer
|
||||
json.NewDecoder(r.Body).Decode(&customer)
|
||||
|
||||
return customer, BuildResponse(r)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user