Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Hey everyone,I'm new here and have a quick quest...

default discord avatar
wkd10792 years ago
1

add the following fields to

Users

collection:



*

role

(select with admin / doctor /patient)


*

qualifications

(array)


*

notes

array



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',
                },
              ],
            },
  • default discord avatar
    hassan_947332 years ago

    Thank you so much !

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.