Fix issue with loading ENV in routes

This commit is contained in:
Leonard Smith 2021-05-26 17:13:55 -05:00
parent c1288004d4
commit 85f640a4b9
2 changed files with 5 additions and 2 deletions

View File

@ -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);
});

View File

@ -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);
});