fix(host-pm-web): save draft before deleting removed documents (#32734)#1123
Conversation
aa5bc16 to
6a0ac0b
Compare
|
Temporary Url for review: https://strr-hosts-dev--pr-1123-psy8tk9s.web.app |
1 similar comment
|
Temporary Url for review: https://strr-hosts-dev--pr-1123-psy8tk9s.web.app |
| storedDocuments.value.splice(index, 0, uiDoc) | ||
| logFetchError(e, 'Error saving draft when removing document') | ||
| strrModal.openErrorModal( | ||
| t('error.docUpload.generic.title'), |
There was a problem hiding this comment.
This generic title/description is for 'Error Uploading Document', which may be confusing for a user when they are trying to delete the document?
There was a problem hiding this comment.
Sure, I'm ok with reusing it, as long as it is added to the ticket requirements and later QA'd.
There was a problem hiding this comment.
Added the paths to be tested to the ticket for visibliity & QA: #1152 (comment)
Call submitApplication with the updated document list before DELETE /documents so application_json stays aligned with storage and examiners avoid 502s on removed files. Restore the document to storedDocuments when draft save fails. Add unit tests for removal when no application id exists, save-then-delete, failed save, and failed delete after save. Made-with: Cursor
6a0ac0b to
9a18314
Compare
|
|
Temporary Url for review: https://strr-hosts-dev--pr-1123-psy8tk9s.web.app |
dimak1
left a comment
There was a problem hiding this comment.
LG! Thanks for making the updates and adding the tests.




Issue:
Description of changes:
strr-host-pm-web): When removing an uploaded document, persist the application draft (with the document removed from the local list) before callingDELETE /documents, soapplication_json.registration.documentsstays consistent with storage and examiners do not hit broken links / 502s for removed files.storedDocuments, log the error, and show the generic document upload error modal.store-document.spec.tsfor removal flows.strr-host-pm-webpatch version.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the BC Registry and Digital Services BSD 3-Clause License