Skip to content

Commit 3b31ff3

Browse files
committed
update
1 parent ad36a9a commit 3b31ff3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

components/zoho_survey/sources/new-survey-response/new-survey-response.mjs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ export default {
4343
recursiveSearch(obj);
4444
return labels;
4545
},
46+
formatValue(value) {
47+
return typeof value === "string"
48+
? decode(value)
49+
: Array.isArray(value)
50+
? value.map((v) => v
51+
? decode(v)
52+
: "")
53+
: "";
54+
},
4655
async formatResponse(body) {
4756
const { variables } = await this.zohoSurvey.listSurveyFields({
4857
portalId: this.portalId,
@@ -63,15 +72,9 @@ export default {
6372
response[key] = labels[key]
6473
? {
6574
label: decode(labels[key]),
66-
value: typeof value === "string"
67-
? decode(value)
68-
: Array.isArray(value)
69-
? value.map((v) => v
70-
? decode(v)
71-
: "")
72-
: "",
75+
value: this.formatValue(value),
7376
}
74-
: decode(value);
77+
: this.formatValue(value);
7578
}
7679
for (const [
7780
key,

0 commit comments

Comments
 (0)