chore: add more helper function
This commit is contained in:
parent
acdbef485a
commit
cf4d3a9967
1 changed files with 8 additions and 0 deletions
|
|
@ -8,3 +8,11 @@ export function throwRelationError(name: string) {
|
|||
`relation${name.replaceAll(" ", "")}NotFound`,
|
||||
);
|
||||
}
|
||||
|
||||
export function throwNotFound(name: string) {
|
||||
throw new HttpError(
|
||||
HttpStatus.BAD_REQUEST,
|
||||
`${name} cannot be found.`,
|
||||
`${name.charAt(0).toLowerCase() + name.replaceAll(" ", "").slice(1)}NotFound`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue