Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Language isn't set when creating a local news#2638 #2761

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
5 changes: 3 additions & 2 deletions sanityv3/initialValueTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Template } from 'sanity'
import { languages } from './languages'
import { defaultLanguage, languages } from './languages'
import textSnippets from './schemas/textSnippets'
import { Flags } from './src/lib/datasetHelpers'

Expand Down Expand Up @@ -79,9 +79,10 @@ const localNewsWithTagTemplate: Template<any, any> = {
id: 'localnews-with-tag',
title: 'Local news',
schemaType: 'localNews',
parameters: [{ name: 'localNewsTag', type: 'reference' }],
parameters: [{ name: 'localNewsTag', type: 'reference' }, { name: 'lang', type: 'string' }],
value: (params: Record<string, unknown>) => ({
localNewsTag: params.localNewsTag,
lang: params.lang || defaultLanguage.name,
}),
}

Expand Down
Loading