Merged in chore/remove-enrichHotel-call (pull request #3244)
Chore/remove enrichHotel call * chore: remove enrichHotel api call * include cityId when errors happen * remove unused funciton and cleanup code * tests no longer expect us to have called a function that is not used * remove commented code Approved-by: Linus Flood
This commit is contained in:
@@ -42,14 +42,18 @@ export async function getHotelIdsByCityId({
|
||||
|
||||
if (!apiResponse.ok) {
|
||||
await metricsGetHotelIdsByCityId.httpError(apiResponse)
|
||||
throw new Error("Unable to fetch hotelIds by cityId")
|
||||
throw new Error(`Unable to fetch hotelIds by cityId`, {
|
||||
cause: { cityId },
|
||||
})
|
||||
}
|
||||
|
||||
const apiJson = await apiResponse.json()
|
||||
const validatedHotelIds = getHotelIdsSchema.safeParse(apiJson)
|
||||
if (!validatedHotelIds.success) {
|
||||
metricsGetHotelIdsByCityId.validationError(validatedHotelIds.error)
|
||||
throw new Error("Unable to parse data for hotelIds by cityId")
|
||||
throw new Error(`Unable to parse data for hotelIds by cityId`, {
|
||||
cause: { cityId, errors: validatedHotelIds.error },
|
||||
})
|
||||
}
|
||||
|
||||
return validatedHotelIds.data
|
||||
|
||||
Reference in New Issue
Block a user