feat: edit an existing custom type
This commit is contained in:
1 parent
083cc9e23e
commit
8e344b2500
57 files changed
+5648
-425
No files matched your search
@@ -0,0 +1,42 @@
|
||||
export function apiField(label: string, key: string, type: string, rest: object = {}) {
|
||||
return {
|
||||
key,
|
||||
label,
|
||||
type,
|
||||
required: false,
|
||||
unique: false,
|
||||
default: null,
|
||||
min: null,
|
||||
max: null,
|
||||
options: null,
|
||||
...rest,
|
||||
}
|
||||
}
|
||||
|
||||
export const eventsFields = [
|
||||
apiField('Title', 'title', 'text', {
|
||||
required: true,
|
||||
unique: true,
|
||||
max: 80,
|
||||
options: [],
|
||||
}),
|
||||
apiField('Starts on', 'starts_on', 'date', { required: true, options: [] }),
|
||||
apiField('Ends on', 'ends_on', 'date', { options: [] }),
|
||||
apiField('Online', 'online', 'boolean', { default: false, options: [] }),
|
||||
apiField('Capacity', 'capacity', 'number', {
|
||||
min: 1,
|
||||
max: 5000,
|
||||
options: [],
|
||||
}),
|
||||
apiField('Category', 'category', 'select', {
|
||||
options: ['Talk', 'Workshop', 'Meetup'],
|
||||
}),
|
||||
apiField('Description', 'description', 'richtext', { options: [] }),
|
||||
]
|
||||
|
||||
export const recipesFields = [
|
||||
apiField('Title', 'title', 'text', { required: true, options: [] }),
|
||||
apiField('Servings', 'servings', 'number', { min: 1, options: [] }),
|
||||
apiField('Vegetarian', 'vegetarian', 'boolean', { options: [] }),
|
||||
apiField('Method', 'method', 'richtext', { options: [] }),
|
||||
]
|
||||
Reference in new issue
Block a user