diff --git a/app/controllers/meetings/publish/notulen.js b/app/controllers/meetings/publish/notulen.js index c52d0c11e..0758e2fbc 100644 --- a/app/controllers/meetings/publish/notulen.js +++ b/app/controllers/meetings/publish/notulen.js @@ -1,3 +1,4 @@ +import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; import {task} from "ember-concurrency"; import {tracked} from "@glimmer/tracking"; @@ -14,6 +15,7 @@ export default class MeetingsPublishNotulenController extends Controller { behandelingContainerId = 'behandeling-van-agendapunten-container'; @tracked publicBehandelingUris = []; @tracked behandelings; + @service publish; constructor() { super(...arguments); @@ -101,10 +103,9 @@ export default class MeetingsPublishNotulenController extends Controller { @task *fetchBehandelings() { const id = this.model.id; - const response = yield fetch(`/prepublish/behandelingen/${id}`); - const json = yield response.json(); + const response = yield this.publish.fetchTreatmentPreviews(id); - return json.map((response) => response.data.attributes); + return response.map((res) => res.data.attributes); } @task diff --git a/app/services/publish.js b/app/services/publish.js index 5f19d3393..ab3e4e5be 100644 --- a/app/services/publish.js +++ b/app/services/publish.js @@ -135,4 +135,7 @@ export default class PublishService extends Service { return await resp.json(); } } + async fetchTreatmentPreviews(meetingId) { + return this.pollForPrepublisherResults(meetingId); + } }