Fixed UserController errors
This commit is contained in:
@@ -78,7 +78,7 @@ export class RoleController {
|
||||
});
|
||||
throw new PermissionsVerificationError(
|
||||
`Unable to verify permissions for role '${this.title}, it is recommended that you override and rewrite these permissions immediately.`,
|
||||
(err as Error).message
|
||||
(err as Error).message,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -248,14 +248,14 @@ export class RoleController {
|
||||
title: string;
|
||||
moniker: string;
|
||||
permissions: string[];
|
||||
}>
|
||||
}>,
|
||||
) {
|
||||
const schema = z
|
||||
.object({
|
||||
title: z.string().min(1, "Title cannot be empty."),
|
||||
moniker: z.string().min(1, "Moniker cannot be empty."),
|
||||
permissions: z.array(
|
||||
z.string().min(1, "Permission node cannot be empty")
|
||||
z.string().min(1, "Permission node cannot be empty"),
|
||||
),
|
||||
})
|
||||
.partial()
|
||||
@@ -271,7 +271,7 @@ export class RoleController {
|
||||
if (checkMoniker)
|
||||
throw new RoleError(
|
||||
"Moniker is already taken.",
|
||||
"Another role with this moniker already exists in the databse."
|
||||
"Another role with this moniker already exists in the databse.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ export class RoleController {
|
||||
id: v.id,
|
||||
name: v.name,
|
||||
login: v.login,
|
||||
roles: v.roles.map((r:any) => r.id),
|
||||
roles: v.roles.map((r: any) => r.id),
|
||||
}))
|
||||
: undefined,
|
||||
createdAt: this.createdAt,
|
||||
|
||||
Reference in New Issue
Block a user