From 997baae4d3f4d02d12e213260ff1e67371f20558 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Tue, 6 Aug 2024 22:28:41 +0200 Subject: [PATCH] Fix JSON serialization in error handling Replaced steps variable with userInput for JSON serialization in error handling. This ensures that the correct data is saved as a JSON blob when a network error occurs. --- src/components/form/genericForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/genericForm.tsx b/src/components/form/genericForm.tsx index ec2364c..df8e137 100644 --- a/src/components/form/genericForm.tsx +++ b/src/components/form/genericForm.tsx @@ -25,7 +25,7 @@ const GenericForm = (formData: FormData) => { body: JSON.stringify(e) }) if (!response.ok) { - let json: string = JSON.stringify(steps); + let json: string = JSON.stringify(userInput); const blob = new Blob([json], {type: "application/json"}); const url = URL.createObjectURL(blob);