I used Select
field but creating with manual select option.I have categories list and I want to create another list which includes category field.I would like to do it with fetching all categories into my Select
field to choose which category I want.How can i do this dynamical ?
Thanks in advance!
const { Text, Select } = require('@keystonejs/fields');
const {Keystone} = require('@keystonejs/keystone');
const options = [
{ value: 'YES', label: "Yes, I'll be there!" },
{ value: 'NO', label: "Sorry, I can't make it :(" },
{ value: 'MAYBE', label: 'Not sure yet' },
];
module.exports={
fields:{
levels:{
type:Select,
options,
isRequired:true
},
tm: {
type: Text,
isRequired:true,
isUnique:true,
},
ru: {
type: Text,
isRequired:true,
isUnique:true,
},
en: {
type: Text,
isRequired:true,
isUnique:true,
},
},
}