Skip to content

Commit 5d0727f

Browse files
committed
fix(sanity): wrap socialFields in defineField for studio typecheck
1 parent 38031b9 commit 5d0727f

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

‎apps/sanity/schemas/custom/social-embed.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineType } from "sanity";
1+
import { defineField, defineType } from "sanity";
22
import type { IconType } from "react-icons";
33
import {
44
FaBluesky,
@@ -13,7 +13,7 @@ import {
1313
} from "react-icons/fa6";
1414

1515
const socialFields = [
16-
{
16+
defineField({
1717
name: "platform",
1818
type: "string",
1919
title: "Platform",
@@ -33,34 +33,34 @@ const socialFields = [
3333
{ title: "YouTube", value: "youtube" },
3434
],
3535
},
36-
},
37-
{
36+
}),
37+
defineField({
3838
name: "url",
3939
type: "url",
4040
title: "Post URL",
41-
validation: (rule: { required: () => unknown }) => rule.required(),
42-
},
43-
{
41+
validation: (rule) => rule.required(),
42+
}),
43+
defineField({
4444
name: "author",
4545
type: "string",
4646
title: "Author Name (Optional)",
47-
},
48-
{
47+
}),
48+
defineField({
4949
name: "handle",
5050
type: "string",
5151
title: "Author Handle (Optional)",
52-
},
53-
{
52+
}),
53+
defineField({
5454
name: "fallbackText",
5555
type: "text",
5656
title: "Post Text / Fallback Excerpt (Optional)",
5757
rows: 3,
58-
},
59-
{
58+
}),
59+
defineField({
6060
name: "caption",
6161
type: "string",
6262
title: "Caption (Optional)",
63-
},
63+
}),
6464
];
6565

6666
function createPlatformEmbedSchema(

0 commit comments

Comments
 (0)