Merged in fix/BOOK-672-hotels-without-related-links (pull request #3348)
fix(BOOK-672): remove unused relationsships that threw when missing * fix(BOOK-672): remove unused relationsships that threw when missing Approved-by: Linus Flood
This commit is contained in:
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
@@ -1,6 +1,13 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Attach",
|
||||||
|
"port": 9229,
|
||||||
|
"request": "attach",
|
||||||
|
"skipFiles": ["<node_internals>/**"],
|
||||||
|
"type": "node"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Web",
|
"name": "Web",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
|
|||||||
@@ -18,11 +18,7 @@ import { sortRoomConfigs } from "../../utils/sortRoomConfigs"
|
|||||||
import { occupancySchema } from "./schemas/availability/occupancy"
|
import { occupancySchema } from "./schemas/availability/occupancy"
|
||||||
import { productTypeSchema } from "./schemas/availability/productType"
|
import { productTypeSchema } from "./schemas/availability/productType"
|
||||||
import { citySchema } from "./schemas/city"
|
import { citySchema } from "./schemas/city"
|
||||||
import {
|
import { attributesSchema, includedSchema } from "./schemas/hotel"
|
||||||
attributesSchema,
|
|
||||||
includedSchema,
|
|
||||||
relationshipsSchema as hotelRelationshipsSchema,
|
|
||||||
} from "./schemas/hotel"
|
|
||||||
import { addressSchema } from "./schemas/hotel/address"
|
import { addressSchema } from "./schemas/hotel/address"
|
||||||
import { detailedFacilitiesSchema } from "./schemas/hotel/detailedFacility"
|
import { detailedFacilitiesSchema } from "./schemas/hotel/detailedFacility"
|
||||||
import { locationSchema } from "./schemas/hotel/location"
|
import { locationSchema } from "./schemas/hotel/location"
|
||||||
@@ -54,7 +50,6 @@ export const hotelSchema = z
|
|||||||
}
|
}
|
||||||
return lang
|
return lang
|
||||||
}),
|
}),
|
||||||
relationships: hotelRelationshipsSchema,
|
|
||||||
type: z.literal("hotels"), // No enum here but the standard return appears to be "hotels".
|
type: z.literal("hotels"), // No enum here but the standard return appears to be "hotels".
|
||||||
}),
|
}),
|
||||||
// NOTE: We can pass an "include" param to the hotel API to retrieve
|
// NOTE: We can pass an "include" param to the hotel API to retrieve
|
||||||
|
|||||||
@@ -69,16 +69,3 @@ export const includedSchema = z
|
|||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
const relationshipSchema = z.object({
|
|
||||||
links: z.object({
|
|
||||||
related: z.string(),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
export const relationshipsSchema = z.object({
|
|
||||||
meetingRooms: relationshipSchema,
|
|
||||||
nearbyHotels: relationshipSchema,
|
|
||||||
restaurants: relationshipSchema,
|
|
||||||
roomCategories: relationshipSchema,
|
|
||||||
})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user