feat(SW-159): merged contentstack and api requests for hotel query

This commit is contained in:
Erik Tiekstra
2024-08-12 16:36:17 +02:00
parent 93e54b4ca1
commit 7fd2fd7ec6
6 changed files with 80 additions and 32 deletions

View File

@@ -59,3 +59,17 @@ export function publicUnauthorizedError() {
cause: new PublicUnauthorizedError(PUBLIC_UNAUTHORIZED),
})
}
export function serverErrorByStatus(status: number, cause?: unknown) {
switch (status) {
case 401:
return unauthorizedError(cause)
case 403:
return forbiddenError(cause)
case 404:
return notFound(cause)
case 500:
default:
return internalServerError(cause)
}
}