From 91729b608d2a7df2241d989a6b10eece5f820783 Mon Sep 17 00:00:00 2001 From: Dan Buchholz Date: Thu, 29 Feb 2024 11:20:12 -0800 Subject: [PATCH] fix: replace single quotes with '' value --- garage/src/components/SubmitMissionModal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/garage/src/components/SubmitMissionModal.tsx b/garage/src/components/SubmitMissionModal.tsx index 449b5484..00693752 100644 --- a/garage/src/components/SubmitMissionModal.tsx +++ b/garage/src/components/SubmitMissionModal.tsx @@ -60,12 +60,15 @@ export const SubmitMissionModal = ({ deliverables.length === mission.deliverables.length && !deliverables.map(({ value }) => value).some(isEmpty); + const sanitizeDeliverables = deliverables.map(({ key, value }) => ({ + [key]: value.replace(/\'/g, "''"), + })); const { config } = usePrepareContractWrite({ chainId: secondaryChain.id, address: as0xString(missionContractAddress), abi, functionName: "submitMissionContribution", - args: [BigInt(mission.id), JSON.stringify(deliverables)], + args: [BigInt(mission.id), JSON.stringify(sanitizeDeliverables)], enabled: isOpen && isValid, });