mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
migration fix (#13156)
This commit is contained in:
parent
6aec215e96
commit
f56ea9292b
1 changed files with 23 additions and 0 deletions
|
|
@ -274,6 +274,29 @@ export class LicenseCountsService implements ILicenseCountsService {
|
|||
manager
|
||||
);
|
||||
}
|
||||
async getUserIdWithEndUserRole(manager: EntityManager): Promise<string[]> {
|
||||
const statusList = [WORKSPACE_USER_STATUS.INVITED, WORKSPACE_USER_STATUS.ACTIVE];
|
||||
|
||||
const users = await manager.find(User, {
|
||||
select: ['id'],
|
||||
where: {
|
||||
status: Not(USER_STATUS.ARCHIVED),
|
||||
organizationUsers: {
|
||||
status: In(statusList),
|
||||
},
|
||||
userPermissions: {
|
||||
name: USER_ROLE.END_USER,
|
||||
organization: {
|
||||
status: WORKSPACE_STATUS.ACTIVE,
|
||||
},
|
||||
},
|
||||
},
|
||||
relations: ['organizationUsers', 'userPermissions', 'userPermissions.organization'],
|
||||
});
|
||||
|
||||
// Extract unique user IDs
|
||||
return [...new Set(users.map((user) => user.id))];
|
||||
}
|
||||
|
||||
async fetchTotalAppCount(organizationId: string, manager: EntityManager): Promise<number> {
|
||||
if (getTooljetEdition() !== TOOLJET_EDITIONS.Cloud) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue