Skip to content

Commit

Permalink
fix: Removing a user from a project will now check to see if that pro…
Browse files Browse the repository at this point in the history
…ject has an owner, rather than checking if any project has an owner
  • Loading branch information
sighphyre committed Jan 12, 2022
1 parent 808a9f5 commit 917ab04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/services/project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 917ab04

Please sign in to comment.