File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import type { APIRequestContext } from '@playwright/test'
55
6- type FieldType = 'text' | 'number'
6+ type FieldType = 'text' | 'number' | 'select'
77type FieldVisibility = 'private' | 'users' | 'public'
88
99type FieldDefinition = {
1010 id : number
1111 field_key : string
1212 label : string
1313 type : FieldType
14+ options : string [ ] | null
1415 admin_only : boolean
1516 user_editable : boolean
1617 user_visible : boolean
@@ -36,6 +37,7 @@ type DefinitionPayload = {
3637 fieldKey : string
3738 label : string
3839 type ?: FieldType
40+ options ?: string [ ]
3941 adminOnly ?: boolean
4042 userEditable ?: boolean
4143 userVisible ?: boolean
@@ -102,6 +104,7 @@ export async function createDefinition(
102104 fieldKey : payload . fieldKey ,
103105 label : payload . label ,
104106 type : payload . type ?? 'text' ,
107+ ...( payload . type === 'select' ? { options : payload . options ?? [ ] } : { } ) ,
105108 adminOnly : payload . adminOnly ?? false ,
106109 userEditable : payload . userEditable ?? true ,
107110 userVisible : payload . userVisible ?? true ,
You can’t perform that action at this time.
0 commit comments