Fix issue with loading ENV in routes
This commit is contained in:
parent
c1288004d4
commit
85f640a4b9
|
@ -1,10 +1,11 @@
|
|||
import Route from '@ember/routing/route';
|
||||
import fetch from 'fetch';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import ENV from 'gwt-frontend/config/environment';
|
||||
|
||||
export default class CommentaryArticleRoute extends Route {
|
||||
async model(params) {
|
||||
const response = await fetch(window.GwtFrontend.hostUrl + '/api/v1/commentary/articles/' + params.article_id);
|
||||
const response = await fetch(ENV.APP.hostUrl + '/api/v1/commentary/articles/' + params.article_id);
|
||||
const body = await response.text().then(function(text){
|
||||
return new htmlSafe(text);
|
||||
});
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import Route from '@ember/routing/route';
|
||||
import fetch from 'fetch';
|
||||
import { htmlSafe } from '@ember/template';
|
||||
import ENV from 'gwt-frontend/config/environment';
|
||||
|
||||
export default class CommentaryIntroRoute extends Route {
|
||||
async model(params) {
|
||||
const response = await fetch(window.GwtFrontend.hostUrl + '/api/v1/commentary/' + params.book_id + '/chapter/intro');
|
||||
console.log(ENV);
|
||||
const response = await fetch(ENV.APP.hostUrl + '/api/v1/commentary/' + params.book_id + '/chapter/intro');
|
||||
const body = await response.text().then(function(text){
|
||||
return new htmlSafe(text);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue