diff --git a/backend/src/routes/users.ts b/backend/src/routes/users.ts index bcdfeb4..cab4f82 100644 --- a/backend/src/routes/users.ts +++ b/backend/src/routes/users.ts @@ -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 ?? 'Администратор'