Skip to content

Commit

Permalink
Merge pull request #559 from 0xPolygonID/main
Browse files Browse the repository at this point in the history
sync: main changes to dev
  • Loading branch information
javip97 authored Nov 23, 2023
2 parents fcbb8b9 + 0d3c8d6 commit b168ae8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions ui/src/adapters/parsers/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function serializeDate(date: dayjs.Dayjs | Date, format: "date" | "date-time" |
return dayjs(date).format(template);
}

function serializeAtrributeValue({
function serializeAttributeValue({
attributeValue,
}: {
attributeValue: AttributeValue;
Expand Down Expand Up @@ -251,13 +251,10 @@ function serializeAtrributeValue({
}
case "object": {
return attributeValue.value !== undefined
? attributeValue.value.reduce(
(acc, curr) => ({
...acc,
[curr.name]: serializeAtrributeValue({ attributeValue: curr }),
}),
{}
)
? attributeValue.value.reduce((acc: JsonObject | undefined, curr) => {
const value = serializeAttributeValue({ attributeValue: curr });
return value !== undefined ? { ...acc, [curr.name]: value } : acc;
}, undefined)
: undefined;
}
case "null": {
Expand Down Expand Up @@ -288,7 +285,7 @@ export function serializeSchemaForm({
);
if (parsedAttributeValue.success) {
return {
data: serializeAtrributeValue({ attributeValue: parsedAttributeValue.data }),
data: serializeAttributeValue({ attributeValue: parsedAttributeValue.data }),
success: true,
};
} else {
Expand Down

0 comments on commit b168ae8

Please sign in to comment.