add the following fields to
Userscollection:
*
role(select with admin / doctor /patient)
*
qualifications(array)
*
notesarray
then use admin config logic to show/hide the conditional fields depending on the selected role;
finally you can configure appointment crud access with access control, filtering on user.role
here's an example from my project showing the conditional field logic:
fields: [
{
name: 'post_type',
label: 'Post Type',
type: 'select',
// required: true,
options: [
{
label: 'Article',
value: 'article',
},
{
label: 'AV',
value: 'av',
},
{
label: 'Short Take',
value: 'short_take',
},
{
label: 'Feature',
value: 'feature',
},
],
},
{
name: 'article_type',
label: 'Article Type',
type: 'select',
required: true,
admin: {
condition: (data) => {
return data?.post_type === 'article'
},
},
options: [
{
label: 'Review',
value: 'review',
},
{
label: 'Interview',
value: 'interview',
},
{
label: 'Essay',
value: 'essay',
},
],
},Thank you so much !
Star
Discord
online
Get dedicated engineering support directly from the Payload team.