fix: ReviewsPage use useAuth for slug; reviews redirect by booking source
- Replace useParams with useAuth().user.hotelSlug in ReviewsPage - Backend: filter platforms by booking source when review_redirect_source=true (booking_com→Booking.com, yandex_travel→Яндекс, airbnb, expedia, vrbo) - If source has matching platform — show only that one; otherwise all platforms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { useAuth } from '../contexts/AuthContext'
|
||||
import {
|
||||
Star, ThumbsDown, Copy, CheckCheck, MessageSquare, QrCode,
|
||||
ArrowUpRight, Plus, Trash2, ExternalLink, Settings2,
|
||||
@@ -65,7 +65,8 @@ type Tab = 'pending' | 'published' | 'all' | 'preview' | 'settings'
|
||||
// ── Component ─────────────────────────────────────────────────────────────────
|
||||
|
||||
export function ReviewsPage() {
|
||||
const { slug } = useParams<{ slug: string }>()
|
||||
const { user } = useAuth()
|
||||
const slug = user?.hotelSlug ?? ''
|
||||
|
||||
const [reviews, setReviews] = useState<ReviewApi[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
Reference in New Issue
Block a user