refactor: rename name→displayName in review files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** Публичное отображение автора отзыва (без «голого» email). */
|
||||
export function publicReviewAuthorDisplay(user) {
|
||||
if (!user || typeof user !== 'object') return 'Покупатель'
|
||||
const name = typeof user.name === 'string' ? user.name.trim() : ''
|
||||
const name = typeof user.displayName === 'string' ? user.displayName.trim() : ''
|
||||
if (name) return name
|
||||
const email = typeof user.email === 'string' ? user.email.trim() : ''
|
||||
const at = email.indexOf('@')
|
||||
|
||||
@@ -56,7 +56,7 @@ export async function registerAdminReviewRoutes(fastify) {
|
||||
rating: updated.rating,
|
||||
text: updated.text || '',
|
||||
productTitle: existing.product?.title || '',
|
||||
userName: existing.user?.name || existing.user?.email || '',
|
||||
userName: existing.user?.displayName || existing.user?.email || '',
|
||||
reviewId: updated.id,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user