fix: notification links use app routes without slug prefix
Some checks failed
Deploy to Production / deploy (push) Has been cancelled
Some checks failed
Deploy to Production / deploy (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -109,7 +109,7 @@ async function runAutoCancelNoShows(): Promise<void> {
|
||||
title: 'Гость не заехал — бронь отменена',
|
||||
body: `${b.guest_name ?? 'Гость'} не заехал вовремя. Бронирование автоматически отмечено как неявка.`,
|
||||
bookingId: b.id,
|
||||
link: `/${hotel.slug}/bookings`,
|
||||
link: '/bookings',
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ async function runAutoCheckouts(): Promise<void> {
|
||||
title: 'Автоматическое выселение',
|
||||
body: `${b.guest_name ?? 'Гость'} выселен автоматически по истечении времени проживания.`,
|
||||
bookingId: b.id,
|
||||
link: `/${hotel.slug}/calendar`,
|
||||
link: '/calendar',
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
@@ -348,7 +348,7 @@ async function runUnreadMessagesJob(): Promise<void> {
|
||||
type: 'unread_messages',
|
||||
title: `Непрочитанные сообщения — ${row.room_name}`,
|
||||
body,
|
||||
link: `/${row.hotel_slug}/chat`,
|
||||
link: '/chat',
|
||||
}).catch(() => {})
|
||||
|
||||
void sendPushForNotification(row.hotel_id, 'unread_messages', {
|
||||
|
||||
@@ -475,7 +475,7 @@ const publicWidget: FastifyPluginAsync = async (fastify) => {
|
||||
title: `Новая бронь через сайт — ${guestName}`,
|
||||
body: `${checkIn} — ${checkOut}, ${nights} ${nights === 1 ? 'ночь' : nights < 5 ? 'ночи' : 'ночей'}`,
|
||||
bookingId,
|
||||
link: `/${hotel.slug}/bookings`,
|
||||
link: '/bookings',
|
||||
})
|
||||
void sendPushForNotification(hotel.id, 'new_booking', {
|
||||
title: `Новая бронь через сайт — ${guestName}`,
|
||||
|
||||
@@ -261,7 +261,7 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
|
||||
type: 'new_review',
|
||||
title: `Новый отзыв — ${rating}★`,
|
||||
body: `${booking.guest_name ?? 'Гость'}${text ? ': ' + text.slice(0, 80) : ''}`,
|
||||
link: `/${hotelSlug}/reviews`,
|
||||
link: '/reviews',
|
||||
})
|
||||
void sendPushForNotification(booking.hotel_id, 'new_review', {
|
||||
title: `Новый отзыв — ${rating}★`,
|
||||
@@ -361,7 +361,7 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
|
||||
type: 'new_review',
|
||||
title: `Новый QR-отзыв — №${room}, ${rating}★`,
|
||||
body: text ? text.slice(0, 80) : `Оценка: ${rating} из 5`,
|
||||
link: `/${slug}/reviews`,
|
||||
link: '/reviews',
|
||||
})
|
||||
void sendPushForNotification(hotel.id, 'new_review', {
|
||||
title: `Новый QR-отзыв — №${room}, ${rating}★`,
|
||||
|
||||
Reference in New Issue
Block a user