mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-05 03:03:58 +10:00
Removing or picking an attachment in the application form used to hit storage immediately, before the sheet was saved or cancelled. Cancelling after removing left the application pointing at a deleted file (broken reference), and cancelling after uploading orphaned the new file in storage. FileAttachmentField is now a pure value control that reports picks/removals instead of calling storage itself. ApplicationFormSheet keeps the picked File staged (with a blob-URL preview) until submit, then uploads -> writes the record -> deletes replaced files, in that order. Closing the sheet without saving only drops files orphaned by a failed save attempt. ApplicationDetailSheet has no save/cancel step, so it applies changes immediately through the applications.attachDocument/removeDocument procedures, which order upload/persist/delete server-side with cross-application reference checks. Fixes #3555