feat: make role name unique and remove key usage

This commit is contained in:
Ali BARIN
2024-09-04 11:07:45 +00:00
parent b089069b8e
commit 63dfb6947e
33 changed files with 51 additions and 55 deletions

View File

@@ -32,7 +32,7 @@ const createUser = async (_parent, params, context) => {
userPayload.roleId = params.input.role.id;
} catch {
// void
const role = await Role.query().findOne({ key: 'admin' });
const role = await Role.findAdmin();
userPayload.roleId = role.id;
}