Add send message endpoint (#13)
This commit is contained in:
parent
6713465737
commit
e7822b9e9a
1 changed files with 28 additions and 1 deletions
|
@ -14,7 +14,8 @@ router.get("/", (req, res) => {
|
|||
"/Wiadomosc.mvc/GetWiadomosciUsuniete",
|
||||
"/NowaWiadomosc.mvc/GetJednostkiUzytkownika",
|
||||
"/Adresaci.mvc/GetAdresaci",
|
||||
"/Wiadomosc.mvc/GetTrescWiadomosci"
|
||||
"/Wiadomosc.mvc/GetTrescWiadomosci",
|
||||
"/NowaWiadomosc.mvc/InsertWiadomosc"
|
||||
].map(item => {
|
||||
return base + item;
|
||||
})
|
||||
|
@ -123,4 +124,30 @@ router.all("/Wiadomosc.mvc/GetTrescWiadomosci", (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.all("/NowaWiadomosc.mvc/InsertWiadomosc", (req, res) => {
|
||||
let data = req.body.incomming;
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": {
|
||||
"Adresaci": data.Adresaci.map(item => {
|
||||
item["PushWiadomosc"] = false;
|
||||
return item;
|
||||
}),
|
||||
"Temat": data.Temat,
|
||||
"Tresc": data.Tresc,
|
||||
"Nadawca": {
|
||||
"Id": null,
|
||||
"Nazwa": "Kowalski Jan",
|
||||
"IdLogin": 0,
|
||||
"IdJednostkaSprawozdawcza": null,
|
||||
"Rola": 0,
|
||||
"PushWiadomosc": null,
|
||||
"Hash": "hash"
|
||||
},
|
||||
"WiadomoscPowitalna": false,
|
||||
"Id": data.Id
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
|
Loading…
Reference in a new issue