diff --git a/app/javascript/retrospring/features/inbox/entry/answer.ts b/app/javascript/retrospring/features/inbox/entry/answer.ts index 14b6b25a..93b0cefc 100644 --- a/app/javascript/retrospring/features/inbox/entry/answer.ts +++ b/app/javascript/retrospring/features/inbox/entry/answer.ts @@ -9,16 +9,9 @@ export function answerEntryHandler(event: Event): void { element.disabled = true; - const shareTo = []; - inboxEntry.querySelectorAll('input[type=checkbox][name=ib-share]:checked') - .forEach((element: HTMLInputElement) => { - shareTo.push(element.getAttribute('data-service')); - }); - const data = { id: element.getAttribute('data-ib-id'), answer: inboxEntry.querySelector('textarea[name=ib-answer]')?.value, - share: JSON.stringify(shareTo), inbox: 'true' }; @@ -36,7 +29,14 @@ export function answerEntryHandler(event: Event): void { } updateDeleteButton(false); showNotification(data.message); - (inboxEntry as HTMLElement).remove(); + + const sharing = inboxEntry.querySelector('.inbox-entry__sharing'); + if (sharing != null) { + sharing.dataset.inboxSharingConfigValue = JSON.stringify(data.sharing); + } + else { + (inboxEntry as HTMLElement).remove(); + } }) .catch(err => { console.log(err); @@ -51,4 +51,4 @@ export function answerEntryInputHandler(event: KeyboardEvent): void { if (event.keyCode == 13 && (event.ctrlKey || event.metaKey)) { document.querySelector(`button[name="ib-answer"][data-ib-id="${inboxId}"]`).click(); } -} \ No newline at end of file +}