This commit is contained in:
@@ -6,6 +6,24 @@ import { schemaTypes } from './src/sanity/schemas'
|
||||
export default defineConfig({
|
||||
projectId: import.meta.env.PUBLIC_SANITY_PROJECT_ID,
|
||||
dataset: import.meta.env.PUBLIC_SANITY_DATASET ?? 'production',
|
||||
document: {
|
||||
// Filter document actions
|
||||
actions: (prev, context) => {
|
||||
// For singleton documents like site settings
|
||||
if (context.schemaType === 'theaterHomepage') {
|
||||
// Only allow publish action (equivalent to ["update", "publish"])
|
||||
return prev.filter(({action}) => action === 'publish')
|
||||
}
|
||||
return prev
|
||||
},
|
||||
|
||||
// Prevent creating new documents of this type
|
||||
newDocumentOptions: (prev, context) => {
|
||||
return prev.filter(
|
||||
(template) => template.templateId !== 'siteSettings'
|
||||
)
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
structureTool({
|
||||
structure: (S) =>
|
||||
|
||||
Reference in New Issue
Block a user