From f46cc0decba2c2f15f07609a4f41a6f2b64f4528 Mon Sep 17 00:00:00 2001 From: Elena Poelman Date: Fri, 6 Sep 2024 12:02:50 +0200 Subject: [PATCH] fix: ensure versioned-notulen related to signatures is marked as deleted when all signatures have been removed --- .changeset/wicked-lamps-press.md | 5 +++++ app/controllers/meetings/publish/notulen.js | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/wicked-lamps-press.md diff --git a/.changeset/wicked-lamps-press.md b/.changeset/wicked-lamps-press.md new file mode 100644 index 000000000..5d267d517 --- /dev/null +++ b/.changeset/wicked-lamps-press.md @@ -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 diff --git a/app/controllers/meetings/publish/notulen.js b/app/controllers/meetings/publish/notulen.js index abafff4c4..7b5506a2f 100644 --- a/app/controllers/meetings/publish/notulen.js +++ b/app/controllers/meetings/publish/notulen.js @@ -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 @@ -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 = []; @@ -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 { @@ -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(); });