14 lines
431 B
JavaScript
14 lines
431 B
JavaScript
|
import Route from '@ember/routing/route';
|
||
|
import fetch from 'fetch';
|
||
|
import { htmlSafe } from '@ember/template';
|
||
|
|
||
|
export default class CommentaryIntroRoute extends Route {
|
||
|
async model(params) {
|
||
|
const response = await fetch('http://gwt.api/api/v1/commentary/' + params.book_id + '/chapter/intro');
|
||
|
const body = await response.text().then(function(text){
|
||
|
return new htmlSafe(text);
|
||
|
});
|
||
|
return { body };
|
||
|
}
|
||
|
}
|