🚧 UserGroups

ref #14
This commit is contained in:
2020-12-04 18:34:14 +01:00
parent 5b7f3ae12f
commit 3275b5fd80
4 changed files with 154 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
import { IsString } from 'class-validator';
import { NotAcceptableError, NotFoundError } from 'routing-controllers';
/**
* Error to throw when no groupname is set
*/
export class GroupNameNeededError extends NotFoundError {
@IsString()
name = "GroupNameNeededError"
@IsString()
message = "no groupname is set!"
}
/**
* Error to throw when a usergroup couldn't be found.
*/
export class UserGroupNotFoundError extends NotFoundError {
@IsString()
name = "UserGroupNotFoundError"
@IsString()
message = "User Group not found!"
}
/**
* Error to throw when two usergroups' ids don't match.
* Usually occurs when a user tries to change a usergroups's id.
*/
export class UserGroupIdsNotMatchingError extends NotAcceptableError {
@IsString()
name = "UserGroupIdsNotMatchingError"
@IsString()
message = "The id's don't match!! \n If you wanted to change a usergroup's id: This isn't allowed"
}