fix(events): show proposed FAQs on pending revision review
Surface revision-payload FAQs on the pending card so admins can review another host's FAQ changes alongside title/slug.
This commit is contained in:
parent
ffa2e2b904
commit
116d1be258
@ -13,7 +13,8 @@ interface AdminEventPendingRevisionCardProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const AdminEventPendingRevisionCard = ({ pendingId, revision, onApprove, onReject }: AdminEventPendingRevisionCardProps) => {
|
const AdminEventPendingRevisionCard = ({ pendingId, revision, onApprove, onReject }: AdminEventPendingRevisionCardProps) => {
|
||||||
const { title, slug } = revision.payload
|
const { title, slug, faqs } = revision.payload
|
||||||
|
const proposedFaqs = Array.isArray(faqs) ? faqs : []
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="admin-surface">
|
<Card className="admin-surface">
|
||||||
@ -43,6 +44,21 @@ const AdminEventPendingRevisionCard = ({ pendingId, revision, onApprove, onRejec
|
|||||||
) : null}
|
) : null}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
{proposedFaqs.length > 0 ? (
|
||||||
|
<div className="space-y-2 text-right">
|
||||||
|
<p className="text-xs text-secondary-30">سوالات متداول پیشنهادی ({proposedFaqs.length.toLocaleString('fa-IR')})</p>
|
||||||
|
{proposedFaqs.map((faq, index) => (
|
||||||
|
<div
|
||||||
|
key={`${faq.question}-${index}`}
|
||||||
|
className="rounded-xl border border-secondary-40 bg-secondary-50/60 p-3"
|
||||||
|
>
|
||||||
|
<h3 className="text-sm font-bold text-secondary-20">{faq.question}</h3>
|
||||||
|
<p className="mt-1 whitespace-pre-line text-xs leading-6 text-secondary-30">{faq.answer}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center justify-end gap-2">
|
<div className="flex flex-wrap items-center justify-end gap-2">
|
||||||
<Button
|
<Button
|
||||||
isLoading={pendingId === 'approve-revision'}
|
isLoading={pendingId === 'approve-revision'}
|
||||||
|
|||||||
@ -9,8 +9,9 @@ export type EventFaq = EventFaqResponseDto
|
|||||||
const eventExtrasApi = getEventExtras()
|
const eventExtrasApi = getEventExtras()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared public list endpoints — backend allows admin reads for event detail/edit.
|
* Shared public list endpoints — after backend admin bypass on list reads,
|
||||||
* No dedicated admin media/FAQ list routes exist in OpenAPI.
|
* authenticated admins can load media/FAQs for any non-deleted event
|
||||||
|
* (detail + edit pages for another host's event).
|
||||||
*/
|
*/
|
||||||
export async function fetchEventMedia(eventId: string): Promise<EventMedia[]> {
|
export async function fetchEventMedia(eventId: string): Promise<EventMedia[]> {
|
||||||
const response = await eventExtrasApi.eventMediaControllerList(eventId)
|
const response = await eventExtrasApi.eventMediaControllerList(eventId)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user