fix: refactor tracking requests
This commit is contained in:
@@ -248,18 +248,9 @@ export const userQueryRouter = router({
|
||||
)
|
||||
|
||||
if (!previousStaysResponse.ok) {
|
||||
// switch (apiResponse.status) {
|
||||
// case 400:
|
||||
// throw badRequestError(apiResponse)
|
||||
// case 401:
|
||||
// throw unauthorizedError(apiResponse)
|
||||
// case 403:
|
||||
// throw forbiddenError(apiResponse)
|
||||
// default:
|
||||
// throw internalServerError(apiResponse)
|
||||
// }
|
||||
console.info(`API Response Failed - Getting Previous Stays`)
|
||||
console.info(`User: (${JSON.stringify(ctx.session.user)})`)
|
||||
console.info(
|
||||
`API Response Failed - Getting Previous Stays for tracking user`
|
||||
)
|
||||
console.error(previousStaysResponse)
|
||||
return notLoggedInUserTrackingData
|
||||
}
|
||||
@@ -268,8 +259,7 @@ export const userQueryRouter = router({
|
||||
const verifiedPreviousStaysData =
|
||||
getStaysSchema.safeParse(previousStaysApiJson)
|
||||
if (!verifiedPreviousStaysData.success) {
|
||||
console.info(`Failed to validate Previous Stays Data`)
|
||||
console.info(`User: (${JSON.stringify(ctx.session.user)})`)
|
||||
console.info(`Failed to validate Previous Stays Data for tracking user`)
|
||||
console.error(verifiedPreviousStaysData.error)
|
||||
return notLoggedInUserTrackingData
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user