假设我有一个拥有许多产品的客户
该 api 有一个PUT: /customers/:id/cancel取消客户并取消所有产品,然后返回客户和产品以进行侧载:
{
customer: {
id: 1,
name: "Customer Name",
canceled: true,
products: [1, 2] },
products: [
{id: 1, customer_id: 1, name: "Product 1", canceled: true},
{id: 2, customer_id: 1, name: "Product 2", canceled: true}
]
}
我将如何:
- 对客户采取该行动?
- 更新 Ember 商店中的所有对象?