4b06f42db7
* sort of works * type fixes * added option to run old way too
18 lines
431 B
TypeScript
18 lines
431 B
TypeScript
import type {
|
|
NotificationPublisher,
|
|
NotificationTypeMessageMap
|
|
} from '@/modules/notifications/helpers/types'
|
|
import { publishMessage } from '@/modules/notifications/services/queue'
|
|
|
|
/**
|
|
* Publish a notification
|
|
*/
|
|
export const publishNotification: NotificationPublisher = async (type, params) => {
|
|
const msg = {
|
|
type,
|
|
...params
|
|
} as NotificationTypeMessageMap[typeof type]
|
|
|
|
return await publishMessage(msg)
|
|
}
|