Skip to content

Commit

Permalink
fix(application-system): Error on removing uploaded documents (#17233)
Browse files Browse the repository at this point in the history
When documents are chosen for uploading and then removed right after it was causing an error because of manipulating a read only property

Co-authored-by: hfhelgason <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent 56493cc commit 74f5c19
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export const FileUploadFormField = ({
const currentValue = watch(id)

const onFileRemoveWhenInAnswers = (fileToRemove: UploadFile) => {
const answers = structuredClone(application.answers)
const updatedAnswers = set(
application.answers,
answers,
id,
currentValue.filter((x: UploadFile) => x.key !== fileToRemove.key),
)
Expand Down

0 comments on commit 74f5c19

Please sign in to comment.