mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
18 lines
437 B
JavaScript
18 lines
437 B
JavaScript
export default {
|
|
middlewares: [
|
|
"withAuthentication",
|
|
"onlyAdmin"
|
|
],
|
|
fn: async (req, res) => {
|
|
const payload = req.body ?? {}
|
|
|
|
global.websocket.io.of("/").emit("notification.broadcast", {
|
|
type: payload.type ?? "info",
|
|
title: payload.title,
|
|
message: payload.message,
|
|
image: payload.image,
|
|
})
|
|
|
|
return res.json({ ok: true })
|
|
}
|
|
} |