fix: use correct notification event name in payment route
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { NOTIFICATION_EVENTS } from '../../../shared/constants/notification-events.js'
|
||||||
import { prisma } from '../lib/prisma.js'
|
import { prisma } from '../lib/prisma.js'
|
||||||
import { createPayment, buildReceipt, getPayment } from '../lib/yookassa.js'
|
import { createPayment, buildReceipt, getPayment } from '../lib/yookassa.js'
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ export async function registerUserPaymentRoutes(fastify) {
|
|||||||
where: { id: orderId },
|
where: { id: orderId },
|
||||||
data: { status: 'PAID' },
|
data: { status: 'PAID' },
|
||||||
})
|
})
|
||||||
request.server.eventBus.emit('PAYMENT_STATUS_CHANGED', {
|
request.server.eventBus.emit(NOTIFICATION_EVENTS.PAYMENT_STATUS_CHANGED, {
|
||||||
orderId,
|
orderId,
|
||||||
userId: order.userId,
|
userId: order.userId,
|
||||||
paymentStatus: 'paid',
|
paymentStatus: 'paid',
|
||||||
|
|||||||
Reference in New Issue
Block a user