hassio-nextcloud-backup/nextcloud_backup/backend/src/routes/messages.ts

19 lines
440 B
TypeScript
Raw Normal View History

import express from "express";
import messageManager from "../tools/messageManager.js";
const messageRouter = express.Router();
messageRouter.get('/', (req, res, next)=>{
res.json(messageManager.get())
2022-10-26 14:09:10 +02:00
});
messageRouter.patch('/:messageId/readed', (req, res, next)=>{
if(messageManager.markReaded(req.params.messageId)){
res.json(messageManager.get());
}else{
res.status(404).send();
}
});
export default messageRouter;