Compare commits

..

1 Commits

Author SHA1 Message Date
Renovate Bot ecf9def443 Update dependency jsonpath-plus to v7
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2023-07-15 04:02:03 +00:00
2 changed files with 7 additions and 1 deletions

View File

@ -36,7 +36,7 @@
"dayjs": "^1.11.0",
"express": "^4.17.1",
"flag-icon-css": "^3.5.0",
"jsonpath-plus": "^6.0.1",
"jsonpath-plus": "^7.2.0",
"node-cron": "^3.0.0",
"roboto-fontface": "^0.10.0",
"rxjs": "~6.6.3",

View File

@ -79,6 +79,12 @@ api.post('/update/health', (req, res) => {
return res.status(401).send('invalid token');
}
const serviceId = req.query.service as string;
if (!config.groups
.map(g => g.services).reduce((x, y) => x.concat(y), [])
.map(s => s.id).includes(serviceId)) {
// TODO remove old caches
return res.send('OK');
}
let services: { id: string, state: string }[] = [];
if (serviceId) {
services = [{id: serviceId, state: JSONPath({path: serviceStatePaths[serviceId], json: req.body, wrap: false})}];