/
CheateRYT
/
Order_database
Обзор
Документация
Войти
/
CheateRYT
/
Order_database
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
server/routes/orders.js
31 строка
1 KB
Lev Rednikov
Feat: fix private router and add create,update,accept order
09 июн 2024, 02:15
09 июн 2024, 02:15
240b7f6
Код
Авторство
О чём код?
const express = require("express"); const router = express.Router(); const { auth } = require("./middleware/auth"); const {executorCheck} = require("./middleware/executorCheck") const { getOrder, addOrder, updateOrder, getOrders, getNotifications, getNotificationsUpdates, getNotificationsNew, getNotificationsCompleted, getMyOrders, getMyOrder, getInfoAboutExecutors } = require("./controllers/orders"); router.get("/getMyOrders", auth, getMyOrders) router.get("/getMyOrder/:orderId", auth, getMyOrder) router.get("/info", auth,getInfoAboutExecutors ) router.get("/notifications/completed", auth, getNotificationsCompleted) router.get("/notifications/updates", auth, getNotificationsUpdates) router.get("/notifications/new", auth, getNotificationsNew) router.get("/notifications", auth, getNotifications) router.get("/:id", auth, getOrder); router.post("/add", auth, addOrder); router.put("/update/:id", auth, executorCheck, updateOrder); router.get("/", auth, getOrders); module.exports = router;