Skip to content

Commit

Permalink
Merge pull request #1019 from tablelandnetwork/dtb/fix-mission-escaping
Browse files Browse the repository at this point in the history
fix: replace single quotes with '' value
  • Loading branch information
dtbuchholz authored Mar 7, 2024
2 parents d640db8 + 91729b6 commit 3188c99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion garage/src/components/SubmitMissionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down

0 comments on commit 3188c99

Please sign in to comment.