Skip to content

Commit

Permalink
Merge pull request #710 from lblod/GN-5032-signing-bug
Browse files Browse the repository at this point in the history
GN-5032: ensure `versioned-notulen` resources related to signed resources are marked as `deleted` when all signatures are removed
  • Loading branch information
abeforgit authored Sep 6, 2024
2 parents 6edce6b + f46cc0d commit f9acd90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-lamps-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'frontend-gelinkt-notuleren': patch
---

When deleting a signature, and all signatures have been removed, ensure that the `deleted` status is set on the `fullNotulen` resource, not the `publicNotulen` resource
8 changes: 6 additions & 2 deletions app/controllers/meetings/publish/notulen.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class MeetingsPublishNotulenController extends Controller {

behandelingContainerId = 'behandeling-van-agendapunten-container';
@tracked notulen;
@tracked fullNotulen;
@tracked fullNotulenContent;
// Since content can be in a file or in the triplestore, handle content independently from the
// notulen itself
Expand All @@ -38,6 +39,8 @@ export default class MeetingsPublishNotulenController extends Controller {
resetController() {
this.notulen = null;
this.notulenContent = null;
this.fullNotulen = null;
this.fullNotulenContent = null;
this.errors = null;
this.validationErrors = null;
this.signedResources = [];
Expand Down Expand Up @@ -213,6 +216,7 @@ export default class MeetingsPublishNotulenController extends Controller {
this.errors = [`Error fetching file contents: ${statusText}`];
},
);
this.fullNotulen = fullNotulen;
} else {
// this means there are no signatures
try {
Expand Down Expand Up @@ -270,8 +274,8 @@ export default class MeetingsPublishNotulenController extends Controller {
// so it is still in the signedResources array.
// we could reload the model here, but then we're reloading twice in one call, which seems unnecessary
if (this.signedResources.length === 1) {
this.notulen.deleted = true;
await this.notulen.save();
this.fullNotulen.deleted = true;
await this.fullNotulen.save();
}
await this.loadNotulen.perform();
});
Expand Down

0 comments on commit f9acd90

Please sign in to comment.