fix: reviews — correct pending/archive logic, rejected_at field, stats, reply email
- Migration 085: add rejected_at to reviews - pending = !isPublic && !reply && !rejectedAt - archived = isPublic || reply || rejectedAt - Stats: avgRating/NPS from all reviews; 'В архиве' = archived count - sendReply: no longer sets isPublic=true on negative reviews - reject: sets rejected_at=NOW() (distinct from pending) - restore: clears rejected_at (now actually works) - Badge 'Отклонён' for rejected reviews, opacity-60 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -482,7 +482,7 @@ export const api = {
|
||||
list: (slug: string) =>
|
||||
req<ReviewApi[]>('GET', `/api/hotels/${slug}/reviews`),
|
||||
|
||||
update: (slug: string, id: string, data: { reply?: string; isPublic?: boolean }) =>
|
||||
update: (slug: string, id: string, data: { reply?: string; isPublic?: boolean; rejected?: boolean }) =>
|
||||
req<ReviewApi>('PATCH', `/api/hotels/${slug}/reviews/${id}`, data),
|
||||
},
|
||||
|
||||
@@ -1874,6 +1874,7 @@ export interface ReviewApi {
|
||||
reply: string | null
|
||||
repliedAt: string | null
|
||||
isPublic: boolean
|
||||
rejectedAt: string | null
|
||||
roomNumber: string | null
|
||||
bookingSource: string | null
|
||||
createdAt: string
|
||||
|
||||
Reference in New Issue
Block a user