Resolving tag and entity slugs in alert API.

This commit is contained in:
2025-04-04 05:56:32 +02:00
parent c37a2ce1a1
commit 99cd551fc0
3 changed files with 20 additions and 8 deletions

View File

@@ -10,11 +10,9 @@ export async function getIdsBySlug(slugs, domain, toMap) {
return null;
}
/* this, naturally, fails if the slug is 69 etc.
if (Number(slug)) {
return Number(slug); // already an ID or missing
if (typeof slug === 'number') {
return slug; // already an ID, tags like 69 should be a string at this stage
}
*/
const id = await redis.hGet(`traxxx:${domain}:id_by_slug`, slug);