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