Skip to content

Commit

Permalink
docs: Add note about delete response
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Nov 27, 2023
1 parent 06aa75b commit e84b4f3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/rest/api/createResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,21 @@ createResource({

Commonly used with [Controller.fetch](/docs/api/Controller#fetch)

#### Response

```json
{ "id": "xyz" }
```

Response should either be the [pk](./Entity.md#pk) as a string (like `'xyz'`). Or an object with the members needed to compute
[Entity.pk](./Entity.md#pk) (like `{id: 'xyz'}`).

If no response is provided, the `process` implementation will attempt to use the url parameters sent as an object to compute
the [Entity.pk](./Entity.md#pk). This enables the default implementation to still work with no response, so long as standard
arguments are used.

This allows [schema.Invalidate](./Invalidate.md) to remove the entity from the [entity table](/docs/concepts/normalization)

### extend() {#extend}

`createResource` builds a great starting point, but often endpoints need to be [further customized](./RestEndpoint.md#typing).
Expand Down

0 comments on commit e84b4f3

Please sign in to comment.