Skip to content

Commit

Permalink
fix: syntax issues in next.js JS blog template (#4952)
Browse files Browse the repository at this point in the history
* Fix schema in no TS blog template in Next

* remove errant ) in postJS
  • Loading branch information
plsrd authored Sep 29, 2023
1 parent 0715a15 commit c672253
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default defineType({
})
`

const authorJS = `export default author = {
const authorJS = `export const author = {
name: 'author',
title: 'Author',
type: 'document',
Expand Down Expand Up @@ -128,7 +128,7 @@ const blockContentTS = `import {defineType, defineArrayMember} from 'sanity'
* type: 'blockContent'
* }
*/
export default defineType({
title: 'Block Content',
name: 'blockContent',
Expand Down Expand Up @@ -204,7 +204,7 @@ const blockContentJS = `/**
* }
*/
export default blockContent = {
export const blockContent = {
title: 'Block Content',
name: 'blockContent',
type: 'array',
Expand Down Expand Up @@ -289,7 +289,7 @@ export default defineType({
})
`

const categoryJS = `export default category = {
const categoryJS = `export const category = {
name: 'category',
title: 'Category',
type: 'document',
Expand Down Expand Up @@ -382,7 +382,7 @@ export default defineType({
})
`

const postJS = `export default post = {
const postJS = `export const post = {
name: 'post',
title: 'Post',
type: 'document',
Expand Down Expand Up @@ -451,7 +451,7 @@ const postJS = `export default post = {
return {...selection, subtitle: author && \`by \${author}\`}
},
},
})
}
`

// Schema definition
Expand All @@ -468,10 +468,10 @@ export const schema: { types: SchemaTypeDefinition[] } = {
}
`

export const blogSchemaJS = `import blockContent from './schemas/blockContent'
import category from './schemas/category'
import post from './schemas/post'
import author from './schemas/author'
export const blogSchemaJS = `import {blockContent} from './schemas/blockContent'
import {category} from './schemas/category'
import {post} from './schemas/post'
import {author} from './schemas/author'
export const schema = {
types: [post, author, category, blockContent],
Expand Down

1 comment on commit c672253

@vercel
Copy link

@vercel vercel bot commented on c672253 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must have Developer access to commit code to Sanity on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/concepts/teams/roles-and-permissions#enterprise-team-account-roles

Please sign in to comment.