Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdc8d9a8e0 |
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-stub",
|
"name": "multi-stub",
|
||||||
"version": "1.2.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "multi-stub",
|
"name": "multi-stub",
|
||||||
"version": "1.2.0",
|
"version": "1.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-stub",
|
"name": "multi-stub",
|
||||||
"version": "1.2.0",
|
"version": "1.1.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,16 +1,40 @@
|
|||||||
const router = require('express').Router()
|
const router = require('express').Router()
|
||||||
const {MasterModel} = require('./model/master')
|
const {MasterModel} = require('./model/master')
|
||||||
const mongoose = require("mongoose")
|
const mongoose = require("mongoose")
|
||||||
|
const {OrderModel} = require("./model/order")
|
||||||
|
|
||||||
|
|
||||||
router.get('/masters', async (req, res,next) => {
|
router.get("/masters", async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const master = await MasterModel.find({})
|
const masters = await MasterModel.find({});
|
||||||
res.status(200).send({success: true, body: master})
|
const orders = await OrderModel.find({});
|
||||||
|
|
||||||
|
const mastersWithOrders = masters.map((master) => {
|
||||||
|
const masterOrders = orders.filter((order) => {
|
||||||
|
return (
|
||||||
|
order?.master && order.master.toString() === master._id.toString()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const schedule = masterOrders.map((order) => ({
|
||||||
|
id: order._id,
|
||||||
|
startWashTime: order.startWashTime,
|
||||||
|
endWashTime: order.endWashTime,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: master._id,
|
||||||
|
name: master.name,
|
||||||
|
schedule: schedule,
|
||||||
|
phone: master.phone,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
res.status(200).send({ success: true, body: mastersWithOrders });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
next(error)
|
next(error);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
router.delete('/masters/:id', async (req, res,next) => {
|
router.delete('/masters/:id', async (req, res,next) => {
|
||||||
const { id } = req.params;
|
const { id } = req.params;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
const router = require("express").Router();
|
|
||||||
|
|
||||||
router.get('/game-links', (request, response) => {
|
|
||||||
response.send(require('./json/game-links/success.json'))
|
|
||||||
})
|
|
||||||
|
|
||||||
router.get('/4u2k-links', (request, response) => {
|
|
||||||
response.send(require('./json/4u2k-links/success.json'))
|
|
||||||
})
|
|
||||||
;
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"data":[
|
|
||||||
{
|
|
||||||
"type": "video",
|
|
||||||
"links": {
|
|
||||||
"l1": "https://www.youtube.com/embed/DsQMLrPdLf8?si=l9X57nHqaSYlxDFf",
|
|
||||||
"l2": "https://www.youtube.com/embed/Dk8AAU_UdVk?si=N8NdYMUCfawdsJGE",
|
|
||||||
"l3": "https://www.youtube.com/embed/HKfDfWrCwEA?si=qPugjiKR8V9eZ-yG",
|
|
||||||
"l4": "https://www.youtube.com/embed/tD-6xHAHrQ4?si=ZFe41gSK8d5gqahW"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "podcast",
|
|
||||||
"links": {
|
|
||||||
"l1": "https://www.youtube.com/embed/RtVs87Nd1MQ?si=i4giUCtbp4Ouqv2W",
|
|
||||||
"l2": "https://www.youtube.com/embed/DfTU5LA_kw8?si=m7fI5Ie9yIGDFCrU",
|
|
||||||
"l3": "https://www.youtube.com/embed/Sp-1fX1Q15I?si=xyealVly9IBMW7Xi",
|
|
||||||
"l4": "https://www.youtube.com/embed/rLYFJYfluRs?si=MjW1beQ-Q9-TAehF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "entertainment",
|
|
||||||
"links": {
|
|
||||||
"l1": "https://www.youtube.com/embed/DiuuglRCchQ?si=8wTVXKbV-mbHuSjW",
|
|
||||||
"l2": "https://www.youtube.com/embed/zmZcIX5PEyo?si=Hbrv32kl0fqcmtV9",
|
|
||||||
"l3": "https://www.youtube.com/embed/Te-TZUjmzFQ?si=fNG16eruoFEY2KNq",
|
|
||||||
"l4": "https://www.youtube.com/embed/si-MQ5qg3zE?si=67mfO6gV80n1ULqo"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"data":[
|
|
||||||
{
|
|
||||||
"title": "ABC",
|
|
||||||
"description": "Мой брат Колян сбацал про меня байку на англицком и несколько фишек кинул для шухера. Англицкий ты вроде знаешь, впряжешься за меня, а?",
|
|
||||||
"link": "https://www.oxfordonlineenglish.com/english-level-test/reading"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Алё, меня слышно?",
|
|
||||||
"description": "Мой кент на мобилу текст записал с иностранкой. Понимаешь, о чём тут говорят?",
|
|
||||||
"link": "https://test-english.com/listening/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Анонимное тестирование",
|
|
||||||
"description": "Ты язык-то нормально знаешь? Проверься, никто угарать не будет",
|
|
||||||
"link": "https://www.ego4u.com/en/cram-up/tests"
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 297 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user