Added "role" to collection, added checks - now I get "The following field is invalid: role" in Admin

default discord avatar
sawariz0r
3 months ago

I must have missed something. Shouldn't it update the existing users in the collection when adding a new field?


The field:


 {
      name: "role",
      type: "radio",
      defaultValue: () => ["user"],
      required: true,
      options: [
        {
          label: "User",
          value: "user",
        },
        {
          label: "Admin",
          value: "admin",
        },
      ],
    },


Any ideas?



EDIT:


Was first using a select instead of radio, so I missed changing the

["user"]

. Solved the issue 🙂

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.