Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changeRole to assign roles without existing members
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
- Loading branch information
Showing
4 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default class ProjectWithoutOwnerError extends Error { | ||
constructor() { | ||
super(); | ||
Error.captureStackTrace(this, this.constructor); | ||
|
||
this.name = this.constructor.name; | ||
this.message = 'A project must have at least one owner'; | ||
} | ||
|
||
toJSON(): any { | ||
const obj = { | ||
isJoi: true, | ||
name: this.constructor.name, | ||
details: [ | ||
{ | ||
validationErrors: [], | ||
message: this.message, | ||
}, | ||
], | ||
}; | ||
return obj; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters