mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Upgrade typeorm to 0.3.x (#5151)
This commit is contained in:
committed by
GitHub
parent
6608e69457
commit
0a5ab560b1
@@ -38,12 +38,12 @@ export abstract class BaseCommand extends Command {
|
||||
};
|
||||
|
||||
async getInstanceOwner(): Promise<User> {
|
||||
const globalRole = await Db.collections.Role.findOneOrFail({
|
||||
const globalRole = await Db.collections.Role.findOneByOrFail({
|
||||
name: 'owner',
|
||||
scope: 'global',
|
||||
});
|
||||
|
||||
const owner = await Db.collections.User.findOne({ globalRole });
|
||||
const owner = await Db.collections.User.findOneBy({ globalRoleId: globalRole.id });
|
||||
|
||||
if (owner) return owner;
|
||||
|
||||
@@ -53,6 +53,6 @@ export abstract class BaseCommand extends Command {
|
||||
|
||||
await Db.collections.User.save(user);
|
||||
|
||||
return Db.collections.User.findOneOrFail({ globalRole });
|
||||
return Db.collections.User.findOneByOrFail({ globalRoleId: globalRole.id });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user