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:
@@ -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 ?? 'Администратор'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user