mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added notification broadcast endpoint
This commit is contained in:
parent
31fe2c1e71
commit
7448c187c2
@ -0,0 +1,18 @@
|
||||
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 })
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
export default () =>{
|
||||
return {
|
||||
hi: "hola xd"
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
export default async () => {
|
||||
global.websocket.io.of("/").emit("new", {
|
||||
hi: "hola xd"
|
||||
})
|
||||
|
||||
return {
|
||||
hi: "hola xd"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user