Fixed UserController errors

This commit is contained in:
2026-01-25 15:09:55 -06:00
parent e76caa68f1
commit d96f18e6cf
2 changed files with 20 additions and 14 deletions
+5 -5
View File
@@ -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,