Assign role route
A route for the admin to assign roles to other users.
Now, we'll create a route so that the admin can assign roles with higher privileges to other users. Let's then begin by creating the file auth/roles/dto/role.dto. We use the @IsEnum()
decorator to check if the field corresponds to a value of an enum.
Then, we shall return to the AuthController
and create the route assignRole()
.
And in the AuthService
, create the namesake method with the logic for assigning a role
.
Commit - Creating assign role route and validating enum in dto
Last updated