Skip to content

Commit

Permalink
Add destroy record examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltazore committed Oct 16, 2023
1 parent e260c92 commit b599090
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export default class ApplicationRoute extends Route {
{
id: 'create-record',
classicFiles: ['old.js'],
octaneFiles: ['new.js'],
octaneFiles: ['in-place-body.js', 'handler.js'],
},
{
id: 'save-record',
classicFiles: ['old.js'],
octaneFiles: ['new.js'],
octaneFiles: ['new.js', 'handler.js'],
},
],
},
Expand All @@ -48,7 +48,7 @@ export default class ApplicationRoute extends Route {
subsections: [
{
id: 'delete-record',
classicFiles: ['old.js'],
classicFiles: ['old.js', 'destroy.js'],
octaneFiles: ['new.js'],
},
],
Expand Down
2 changes: 2 additions & 0 deletions snippets/deleting-data/delete-record/destroy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const user = this.store.peekRecord('user', '1');
await user.destroyRecord();
1 change: 1 addition & 0 deletions snippets/deleting-data/delete-record/old.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const user = this.store.peekRecord('user', '1');
user.deleteRecord();
await user.save();
user.unloadRecord();

0 comments on commit b599090

Please sign in to comment.