feat: add update status and masters (#67)
This commit is contained in:
@@ -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'));
|
||||
|
||||
@@ -6,9 +6,14 @@
|
||||
"name": "Иван Иванов",
|
||||
"phone": "+7 900 123 45 67"
|
||||
},
|
||||
{
|
||||
"name": "Олег Макаров",
|
||||
"phone": "79001234567",
|
||||
"id": "23423442"
|
||||
},
|
||||
{
|
||||
"id": "345354234",
|
||||
"name": "Иван Иванов",
|
||||
"name": "Иван Галкин",
|
||||
"schedule": [ {
|
||||
"id": "order1",
|
||||
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||
|
||||
@@ -7,10 +7,14 @@
|
||||
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||
"endWashTime": "2024-11-24T16:30:00.000Z",
|
||||
"orderDate": "2024-11-24T08:41:46.366Z",
|
||||
"status": "progress",
|
||||
"status": "pending",
|
||||
"phone": "79001234563",
|
||||
"location": "Казань, ул. Баумана, 1",
|
||||
"master": [],
|
||||
"master": {
|
||||
"name": "Олег Макаров",
|
||||
"phone": "79001234567",
|
||||
"id": "23423442"
|
||||
},
|
||||
"notes": ""
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user