Skip to content

Commit

Permalink
Merge pull request #626 from lblod/feature/notulen-content-as-file
Browse files Browse the repository at this point in the history
fetch content from file if not present on the versioned-notulen
  • Loading branch information
abeforgit authored Mar 21, 2024
2 parents d78cae4 + e3ee35a commit 292c567
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-baboons-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frontend-gelinkt-notuleren": minor
---

support notulen publications as files
7 changes: 7 additions & 0 deletions app/controllers/meetings/publish/notulen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Controller from '@ember/controller';
import { task } from 'ember-concurrency';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { isEmpty } from '@ember/utils';

export default class MeetingsPublishNotulenController extends Controller {
@service store;
Expand Down Expand Up @@ -148,6 +149,12 @@ export default class MeetingsPublishNotulenController extends Controller {
this.publishedResource = publishedResource;
}
this.publicBehandelingUris = publicNotulen.publicBehandelingen || [];
if (isEmpty(publicNotulen.content)) {
const fileMeta = await publicNotulen.file;
publicNotulen.content = await (
await fetch(fileMeta.downloadLink)
).text();
}
this.notulen = publicNotulen;
} else {
try {
Expand Down
1 change: 1 addition & 0 deletions app/models/versioned-notulen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export default class VersionedNotulesModel extends Model {
publishedResource;
@belongsTo('editor-document', { inverse: null }) editorDocument;
@belongsTo('zitting', { inverse: null }) zitting;
@belongsTo('file', { inverse: null }) file;
}

0 comments on commit 292c567

Please sign in to comment.