Додана сторінка "Стенд"

Додане повідомлення про оновлення застосунку
Оновлен Service Worker
Перероблен WebSocket APІ
This commit is contained in:
2025-10-19 00:55:30 +03:00
parent 6ec6523d71
commit 3f08f3f6c9
46 changed files with 2651 additions and 2691 deletions

View File

@@ -4,7 +4,26 @@ class StandController {
async getStand(req, res) {
const { stand_id } = req.params;
return res.status(200).send({ stand_id });
if (stand_id) {
if (req.possibilities.can_view_stand) {
const result = await StandService.getStand(stand_id);
if (result) {
return res.status(200).send(result);
} else {
return res.status(404).send({
message: 'Stand not found.'
});
}
} else {
return res
.status(403)
.send({ message: 'The sheep does not have enough rights.' });
}
} else {
return res
.status(401)
.send({ message: 'Stand not found.' });
}
}
async getList(req, res) {
@@ -23,7 +42,6 @@ class StandController {
.status(404)
.send({ message: 'The sheep does not have enough rights.' });
}
}
async createStand(req, res) {
@@ -130,7 +148,29 @@ class StandController {
}
async getScheduleList(req, res) {
return res.status(200).send({});
const { stand_id } = req.params;
if (stand_id) {
if (req.possibilities.can_view_stand) {
const result = await StandService.getScheduleList(stand_id);
if (result) {
return res.status(200).send(result);
} else {
return res
.status(404)
.send({ message: 'Schedule not found.' });
}
} else {
return res
.status(404)
.send({ message: 'The sheep does not have enough rights.' });
}
} else {
return res
.status(401)
.send({ message: 'Stand id not found.' });
}
}
async getScheduleHistory(req, res) {