Merged in fix/SW-2528 (pull request #2688)
fix(SW-2528): get correct restaurant type * fix(SW-2528): get correct type Approved-by: Erik Tiekstra
This commit is contained in:
@@ -26,7 +26,7 @@ export default async function RestaurantBarItem({
|
|||||||
menus,
|
menus,
|
||||||
restaurantPage,
|
restaurantPage,
|
||||||
mainBody,
|
mainBody,
|
||||||
type,
|
restaurantType,
|
||||||
} = restaurant
|
} = restaurant
|
||||||
const visibleImages = restaurant.content.images.slice(0, 2)
|
const visibleImages = restaurant.content.images.slice(0, 2)
|
||||||
|
|
||||||
@@ -37,7 +37,10 @@ export default async function RestaurantBarItem({
|
|||||||
return (
|
return (
|
||||||
<div className={styles.restaurantBarItem}>
|
<div className={styles.restaurantBarItem}>
|
||||||
<div className={styles.stickyHeading}>
|
<div className={styles.stickyHeading}>
|
||||||
<MaterialIcon icon={getRestaurantIconName(type)} color="CurrentColor" />
|
<MaterialIcon
|
||||||
|
icon={getRestaurantIconName(restaurantType)}
|
||||||
|
color="CurrentColor"
|
||||||
|
/>
|
||||||
<Typography variant="Title/Subtitle/lg">
|
<Typography variant="Title/Subtitle/lg">
|
||||||
<h3>{name}</h3>
|
<h3>{name}</h3>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ const openingDetailsSchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const restaurantsSchema = z.object({
|
export const restaurantsSchema = z.object({
|
||||||
attributes: z.object({
|
attributes: z
|
||||||
|
.object({
|
||||||
bookTableUrl: nullableStringValidator,
|
bookTableUrl: nullableStringValidator,
|
||||||
content: contentSchema,
|
content: contentSchema,
|
||||||
elevatorPitch: z.string().optional(),
|
elevatorPitch: z.string().optional(),
|
||||||
@@ -91,7 +92,11 @@ export const restaurantsSchema = z.object({
|
|||||||
restaurantPage: z.boolean().default(false),
|
restaurantPage: z.boolean().default(false),
|
||||||
specialAlerts: specialAlertsSchema,
|
specialAlerts: specialAlertsSchema,
|
||||||
type: z.string(),
|
type: z.string(),
|
||||||
}),
|
})
|
||||||
|
.transform(({ type, ...rest }) => ({
|
||||||
|
...rest,
|
||||||
|
restaurantType: type,
|
||||||
|
})),
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
type: z.literal("restaurants"),
|
type: z.literal("restaurants"),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user