Basic page for creating roles in dashboard
Closed this issue · 0 comments
TituxMetal commented
Acceptance Criteria
- Displays a form with fields for 'name', 'displayName', 'description'
- The role must be added to the database
- An error message must be displayed in case of invalid field or other problem
- Redirect to dashboard
Implementation Plan
Data Modeling
- Roles schema
Details
- id String cuid
- name String Unique
- displayName String Unique
- description String
- createdAt DateTime
- updatedAt DateTime
- User schema update
Details
- roleId Role
- make migrations
Basic page for creating roles in dashboard
- In action, check for existing role on 'name' or 'displayName'
- Make a zod validation schema
- Show a global error message if a problem occurs when creating the role
- Show validation error message on individual field if it is not valid