1
0
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:
sighphyre 2022-01-12 11:46:06 +02:00
parent 808a9f5229
commit 917ab04d40

View File

@ -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');
}