Skip to content

Commit

Permalink
Make the fix compatible with treatment hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
abeforgit committed Aug 18, 2021
1 parent df1b503 commit 674d765
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/meetings/publish/notulen.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -14,6 +15,7 @@ export default class MeetingsPublishNotulenController extends Controller {
behandelingContainerId = 'behandeling-van-agendapunten-container';
@tracked publicBehandelingUris = [];
@tracked behandelings;
@service publish;

constructor() {
super(...arguments);
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions app/services/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,7 @@ export default class PublishService extends Service {
return await resp.json();
}
}
async fetchTreatmentPreviews(meetingId) {
return this.pollForPrepublisherResults(meetingId);
}
}

0 comments on commit 674d765

Please sign in to comment.