From 778ce009549b26561ea121fc2647c9fa8b6c1d28 Mon Sep 17 00:00:00 2001 From: Kirill Shaplyko Date: Sat, 6 Jul 2024 19:09:32 +0200 Subject: [PATCH] Add lang attribute to fix filenames --- src/markdown/tutorial/part-2/11-ember-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markdown/tutorial/part-2/11-ember-data.md b/src/markdown/tutorial/part-2/11-ember-data.md index f187bb4..2b93c50 100644 --- a/src/markdown/tutorial/part-2/11-ember-data.md +++ b/src/markdown/tutorial/part-2/11-ember-data.md @@ -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; @@ -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';