mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-23 13:46:45 +02:00
fix: Removing a user from a project will now check to see if that project has an owner, rather than checking if any project has an owner
This commit is contained in:
parent
808a9f5229
commit
917ab04d40
@ -335,7 +335,10 @@ export default class ProjectService {
|
||||
}
|
||||
|
||||
if (role.name === RoleName.OWNER) {
|
||||
const users = await this.accessService.getUsersForRole(role.id);
|
||||
const users = await this.accessService.getProjectUsersForRole(
|
||||
role.id,
|
||||
projectId,
|
||||
);
|
||||
if (users.length < 2) {
|
||||
throw new Error('A project must have at least one owner');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user