Skip to content

Commit a70ef52

Browse files
committed
small fixes to docs
1 parent 73dde90 commit a70ef52

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

packages/active-record/src/-private/builders/save-record.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
3434
* import { deleteRecord } from '@ember-data/active-record/request';
3535
*
3636
* const person = this.store.peekRecord('person', '1');
37+
*
38+
* // mark record as deleted
39+
* store.deleteRecord(person);
40+
*
41+
* // persist deletion
3742
* const data = await store.request(deleteRecord(person));
3843
* ```
3944
*
@@ -52,9 +57,14 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
5257
* - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
5358
*
5459
* ```ts
55-
* import { createRecord } from '@ember-data/active-record/request';
60+
* import { deleteRecord } from '@ember-data/active-record/request';
5661
*
5762
* const person = this.store.peekRecord('person', '1');
63+
*
64+
* // mark record as deleted
65+
* store.deleteRecord(person);
66+
*
67+
* // persist deletion
5868
* const options = deleteRecord(person, { namespace: 'api/v1' });
5969
* const data = await store.request(options);
6070
* ```

packages/json-api/src/-private/builders/save-record.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
3333
* import { deleteRecord } from '@ember-data/json-api/request';
3434
*
3535
* const person = this.store.peekRecord('person', '1');
36+
*
37+
* // mark record as deleted
38+
* store.deleteRecord(person);
39+
*
40+
* // persist deletion
3641
* const data = await store.request(deleteRecord(person));
3742
* ```
3843
*
@@ -51,9 +56,14 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
5156
* - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
5257
*
5358
* ```ts
54-
* import { createRecord } from '@ember-data/json-api/request';
59+
* import { deleteRecord } from '@ember-data/json-api/request';
5560
*
5661
* const person = this.store.peekRecord('person', '1');
62+
*
63+
* // mark record as deleted
64+
* store.deleteRecord(person);
65+
*
66+
* // persist deletion
5767
* const options = deleteRecord(person, { namespace: 'api/v1' });
5868
* const data = await store.request(options);
5969
* ```

packages/rest/src/-private/builders/save-record.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
3434
* import { deleteRecord } from '@ember-data/rest/request';
3535
*
3636
* const person = this.store.peekRecord('person', '1');
37+
*
38+
* // mark record as deleted
39+
* store.deleteRecord(person);
40+
*
41+
* // persist deletion
3742
* const data = await store.request(deleteRecord(person));
3843
* ```
3944
*
@@ -52,9 +57,14 @@ function isExisting(identifier: StableRecordIdentifier): identifier is StableExi
5257
* - `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)
5358
*
5459
* ```ts
55-
* import { createRecord } from '@ember-data/rest/request';
60+
* import { deleteRecord } from '@ember-data/rest/request';
5661
*
5762
* const person = this.store.peekRecord('person', '1');
63+
*
64+
* // mark record as deleted
65+
* store.deleteRecord(person);
66+
*
67+
* // persist deletion
5868
* const options = deleteRecord(person, { namespace: 'api/v1' });
5969
* const data = await store.request(options);
6070
* ```

0 commit comments

Comments
 (0)