feature/admin-settings-visibility #11
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import { getCalendarRanges, expandBlockedDates } from '../../../lib/calendar';
|
|||
import { verifyAccessToken } from '../../../lib/jwt';
|
||||
import AvailabilityCalendar from '../../components/AvailabilityCalendar';
|
||||
import { getSiteSettings } from '../../../lib/settings';
|
||||
import type { UrlObject } from 'url';
|
||||
|
||||
type ListingPageProps = {
|
||||
params: { slug: string };
|
||||
|
|
@ -118,7 +119,7 @@ export default async function ListingPage({ params }: ListingPageProps) {
|
|||
const contactParts = [listing.contactName, listing.contactEmail, listing.contactPhone].filter(Boolean) as string[];
|
||||
const contactLine = contactParts.length ? contactParts.join(' · ') : '—';
|
||||
const canViewContact = !siteSettings.requireLoginForContactDetails || Boolean(viewerId);
|
||||
const loginRedirectUrl = `/auth/login?redirect=${encodeURIComponent(`/listings/${params.slug}`)}`;
|
||||
const loginRedirectUrl: UrlObject = { pathname: '/auth/login', query: { redirect: `/listings/${params.slug}` } };
|
||||
const coverImage = listing.images.find((img) => img.isCover) ?? listing.images[0] ?? null;
|
||||
const priceCandidates = [listing.priceWeekdayEuros, listing.priceWeekendEuros].filter((p): p is number => typeof p === 'number');
|
||||
const startingFromEuros = priceCandidates.length ? Math.min(...priceCandidates) : null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue