fix: loyalty route — use request.user.sub instead of userId
This commit is contained in:
@@ -207,7 +207,7 @@ const loyaltyRoutes: FastifyPluginAsync = async (fastify) => {
|
|||||||
await db.query(
|
await db.query(
|
||||||
`INSERT INTO loyalty_transactions (hotel_id, guest_id, amount, reason, notes, staff_id)
|
`INSERT INTO loyalty_transactions (hotel_id, guest_id, amount, reason, notes, staff_id)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6)`,
|
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 {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user