改造实时事件缓存同步
This commit is contained in:
@@ -122,6 +122,8 @@ export async function remindWorkerAcceptanceAdminNotification(workOrderId: numbe
|
||||
type: 'admin_notification.changed',
|
||||
entityId: Number(notification.id),
|
||||
scopes: ['admin_notifications'],
|
||||
operation: 'upsert',
|
||||
data: mapAdminNotification(notification),
|
||||
admin: true,
|
||||
})
|
||||
}
|
||||
@@ -147,6 +149,8 @@ export async function resolveAdminNotificationEntity(
|
||||
type: 'admin_notification.changed',
|
||||
entityId,
|
||||
scopes: ['admin_notifications'],
|
||||
operation: 'remove',
|
||||
data: { notificationId: entityId },
|
||||
admin: true,
|
||||
})
|
||||
}
|
||||
@@ -163,7 +167,7 @@ export async function listAdminPendingNotifications(limit = 20) {
|
||||
}
|
||||
}
|
||||
|
||||
function mapAdminNotification(row: AdminNotificationRow) {
|
||||
export function mapAdminNotification(row: AdminNotificationRow) {
|
||||
return {
|
||||
notificationId: Number(row.id),
|
||||
notificationType: row.notification_type,
|
||||
@@ -215,6 +219,8 @@ async function createConfiguredWorkerPlatformNotification(
|
||||
type: 'admin_notification.changed',
|
||||
entityId: Number(notification.id),
|
||||
scopes: ['admin_notifications'],
|
||||
operation: 'upsert',
|
||||
data: mapAdminNotification(notification),
|
||||
admin: true,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user