Skip to content

Commit e17320e

Browse files
fix: make Template.importUrl nullable+optional for user templates
User templates omit `import_url` entirely from the response (see map_user_template_to_contentful_response in todoist/apps/import_export/ controllers/common.py), so the schema needs to accept undefined as well as null. Surfaced by a live `getTemplates({ templateSource: 'user' })` call, which was failing with "expected string, received undefined". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 035fe81 commit e17320e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/types/templates/types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const TemplateSchema = z.object({
5555
shortDescription: z.string(),
5656
longDescription: z.string(),
5757
instructions: z.string().nullable(),
58-
importUrl: z.string().nullable(),
58+
importUrl: z.string().nullable().optional(),
5959
viewType: z.enum(PROJECT_VIEW_STYLES).optional(),
6060
thumbnailImage: z.string().nullable(),
6161
thumbnailImageDark: z.string().nullable(),

0 commit comments

Comments
 (0)