Skip to content

Commit

Permalink
Merge pull request #243 from Baltazore/fix-filenames
Browse files Browse the repository at this point in the history
Add lang attribute to fix filenames
  • Loading branch information
IgnaceMaes authored Jul 6, 2024
2 parents f766728 + 778ce00 commit 083461e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/11-ember-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ The first thing we want to do is have our builder respect a configurable default
Adding the `.json` extension is a bit less common, and doesn't have a declarative configuration API of its own. We could just modify request options directly in place of use, but that would be a bit messy. Instead, let's create a handler to do this for us.
```run:file:create cwd=super-rentals filename=app/utils/handlers.js
```run:file:create lang=js cwd=super-rentals filename=app/utils/handlers.js
export const JsonSuffixHandler = {
request(context, next) {
const { request } = context;
Expand All @@ -306,7 +306,7 @@ As you can see, the handler appends `.json` to the URL of each request. Pretty s
The next step that we need to do, is to configure `RequestManager` to use this handler. Let's create the request-manager service.
```run:file:create cwd=super-rentals filename=app/services/request-manager.js
```run:file:create lang=js cwd=super-rentals filename=app/services/request-manager.js
import BaseRequestManager from '@ember-data/request';
import Fetch from '@ember-data/request/fetch';
import { JsonSuffixHandler } from 'super-rentals/utils/handlers';
Expand Down

0 comments on commit 083461e

Please sign in to comment.