fix deprecated endpoints

This commit is contained in:
Emily
2024-06-09 23:02:12 +02:00
parent 734335c744
commit 81dd525025

View File

@@ -34,9 +34,17 @@ router.post('/metrics/push', json(jsonOptions), async (req, res) => {
const { type } = req.body;
if (type === 0) {
await RedisStreamService.addToStream(streamName, { ...req.body, _type: 'visit', sessionHash, ip });
await RedisStreamService.addToStream(streamName, {
...req.body, _type: 'visit', sessionHash, ip,
screenWidth: '0',
screenHeight: '0',
type: req.body.type.toString()
});
} else {
await RedisStreamService.addToStream(streamName, { ...req.body, _type: 'event', sessionHash, ip });
await RedisStreamService.addToStream(streamName, {
...req.body, _type: 'event', sessionHash, ip,
type: req.body.type.toString()
});
}
return res.sendStatus(200);