fix: use default role for fallback user creation

This commit is contained in:
Ali BARIN
2023-09-28 14:49:49 +00:00
parent 410f9d0af5
commit c0b8e6178d

View File

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