Skip to content

Commit c4d51e0

Browse files
authored
refactor: Update optional properties input in schema (#2754)
1 parent 259ff7c commit c4d51e0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/pink-bobcats-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/sdk": patch
3+
---
4+
5+
handle `[[{}]]` values for `properties` / `attributes` fields of NFTs

legacy_packages/sdk/src/core/schema/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ const PropertiesInput = /* @__PURE__ */ (() =>
99
*/
1010
export const OptionalPropertiesInput = /* @__PURE__ */ (() =>
1111
z
12-
.union([z.array(PropertiesInput), PropertiesInput])
12+
.union([z.array(z.array(PropertiesInput)).transform(i => i.flat()), z.array(PropertiesInput), PropertiesInput])
1313
.optional()
1414
.nullable())();

0 commit comments

Comments
 (0)