feat: add update status and masters (#67)
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit
it-academy/dry-wash-pl/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2025-01-25 17:12:02 +03:00
parent 85d96b930c
commit 0ddcaa5d52
8 changed files with 97 additions and 17 deletions

View File

@@ -8,8 +8,8 @@ const commonError = { success: false, message: 'Что-то пошло не та
const sleep =
(duration = 1000) =>
(req, res, next) =>
setTimeout(next, duration);
(req, res, next) =>
setTimeout(next, duration);
router.use(sleep());
@@ -53,6 +53,16 @@ router.delete('/arm/masters/:id', (req, res) => {
);
});
router.patch('/orders/id', (req, res) => {
res
.status(/error/.test(STUBS.orders) ? 500 : 200)
.send(
/^error$/.test(STUBS.orders)
? commonError
: require(`../json/arm-orders/${STUBS.orders}.json`),
);
});
router.post('/arm/orders', (req, res) => {
res
.status(/error/.test(STUBS.orders) ? 500 : 200)
@@ -77,9 +87,7 @@ router.get('/order/:orderId', ({ params }, res) => {
});
router.post('/order/create', (req, res) => {
res
.status(200)
.send({ success: true, body: { ok: true } });
res.status(200).send({ success: true, body: { ok: true } });
});
router.use('/admin', require('./admin'));