Merged in fix/SW-1145-occupancy-room-api-change (pull request #1148)
Fix/SW-1145 occupancy room api change * fix(SW-1145): change occupancy to min and max * fix(SW-1145): small edit * fix(SW-1145): refactor to transform total room occupancy * fix(SW-1145): remove space * fix(SW-1145): small fix * fix(SW-1145): change to max for readability Approved-by: Erik Tiekstra Approved-by: Linus Flood
This commit is contained in:
committed by
Linus Flood
parent
1018b3ebcd
commit
a620be9331
@@ -83,9 +83,8 @@ export const roomSchema = z
|
||||
roomTypes: z.array(roomTypesSchema),
|
||||
roomFacilities: z.array(roomFacilitiesSchema),
|
||||
occupancy: z.object({
|
||||
total: z.number().optional(),
|
||||
adults: z.number().optional(),
|
||||
children: z.number().optional(),
|
||||
min: z.number(),
|
||||
max: z.number(),
|
||||
}),
|
||||
roomSize: z.object({
|
||||
min: z.number(),
|
||||
@@ -102,6 +101,16 @@ export const roomSchema = z
|
||||
images: data.attributes.content.images,
|
||||
name: data.attributes.name,
|
||||
occupancy: data.attributes.occupancy,
|
||||
totalOccupancy:
|
||||
data.attributes.occupancy.min === data.attributes.occupancy.max
|
||||
? {
|
||||
max: data.attributes.occupancy.max,
|
||||
range: `${data.attributes.occupancy.max}`,
|
||||
}
|
||||
: {
|
||||
max: data.attributes.occupancy.max,
|
||||
range: `${data.attributes.occupancy.min}-${data.attributes.occupancy.max}`,
|
||||
},
|
||||
roomSize: data.attributes.roomSize,
|
||||
roomTypes: data.attributes.roomTypes,
|
||||
sortOrder: data.attributes.sortOrder,
|
||||
|
||||
Reference in New Issue
Block a user