diff --git a/backend/src/routes/loyalty.ts b/backend/src/routes/loyalty.ts index ba392e1..9fc54cb 100644 --- a/backend/src/routes/loyalty.ts +++ b/backend/src/routes/loyalty.ts @@ -207,7 +207,7 @@ const loyaltyRoutes: FastifyPluginAsync = async (fastify) => { await db.query( `INSERT INTO loyalty_transactions (hotel_id, guest_id, amount, reason, notes, staff_id) VALUES ($1, $2, $3, $4, $5, $6)`, - [hotelId, guestId, amount, reason, notes ?? null, request.user.userId ?? null], + [hotelId, guestId, amount, reason, notes ?? null, request.user.sub ?? null], ) return {