From e9e4e58558abbf72809429d2fd3f6ae4c0159b02 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 15 Oct 2024 17:29:57 -0400 Subject: [PATCH] fix: replace all occurrances of match in survey --- src/components/Survey/Survey.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Survey/Survey.vue b/src/components/Survey/Survey.vue index 7112fee..cbb7253 100644 --- a/src/components/Survey/Survey.vue +++ b/src/components/Survey/Survey.vue @@ -339,9 +339,9 @@ else if (!val && string.includes('includes')) { // if val is undefined and is supposed to be a list val = `[]`; } - output = output.replace(new RegExp(`\\b${k}\\b`), val); + output = output.replaceAll(new RegExp(`\\b${k}\\b`, 'g'), val); } else { - output = output.replace(new RegExp(`\\b${k}\\b`), 0); + output = output.replaceAll(new RegExp(`\\b${k}\\b`, 'g'), 0); } }); // console.log(356, output);