diff --git a/src/lib/features/project/project-owners-read-model.ts b/src/lib/features/project/project-owners-read-model.ts index c7138cce2746..463cd8648417 100644 --- a/src/lib/features/project/project-owners-read-model.ts +++ b/src/lib/features/project/project-owners-read-model.ts @@ -159,9 +159,10 @@ export class ProjectOwnersReadModel implements IProjectOwnersReadModel { } async getUserProjectOwners(projectId: string): Promise { - const allOwners = await this.getProjectOwnersDictionary(); - return (allOwners[projectId] ?? []).filter( - (owner) => owner.ownerType === 'user', - ) as UserProjectOwner[]; + const ownerRole = await this.db(T.ROLES) + .where({ name: RoleName.OWNER }) + .first(); + const usersDict = await this.getAllProjectUsersByRole(ownerRole.id); + return usersDict[projectId] ?? []; } }