Skip to content

Commit 33fdcc2

Browse files
authored
Update handler.js to allow access to MUTATION_OPS
This moves mutation ops to a constant outside the object. The original example will result in MUTATION_OPS not found.
1 parent e5a6ff2 commit 33fdcc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

snippets/updating-data/create-record/handler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import { recordIdentifierFor } from '@ember-data/store';
33
import { serializeResources } from '@ember-data/json-api/request';
44

5-
const updatesHandler = {
6-
MUTATION_OPS: new Set(['createRecord', 'updateRecord']),
5+
const MUTATION_OPS = new Set(['createRecord', 'updateRecord']);
6+
77

8+
const updatesHandler = {
89
request(context, next) {
910
if (!MUTATION_OPS.has(context.request.op)) {
1011
// Not a mutation, do nothing

0 commit comments

Comments
 (0)