fix: use request.user.sub instead of .id in users route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 00:07:16 +03:00
parent 1ab2751854
commit 6ba591928a

View File

@@ -102,7 +102,7 @@ const users: FastifyPluginAsync = async (fastify) => {
// Look up hotel name and inviter name for the email
const { rows: hotelRows } = await db.query('SELECT name FROM hotels WHERE id = $1', [hotelId])
const { rows: inviterRows } = await db.query('SELECT name FROM users WHERE id = $1', [request.user.id])
const { rows: inviterRows } = await db.query('SELECT name FROM users WHERE id = $1', [request.user.sub])
const hotelName = hotelRows[0]?.name ?? 'отель'
const invitedBy = inviterRows[0]?.name ?? 'Администратор'