fix: getLogBatchGroupedByBody missing return bug (#115)

This commit is contained in:
Warren 2023-11-20 02:03:20 -08:00 committed by GitHub
parent b189070be0
commit 9a72b85ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -0,0 +1,6 @@
---
'@hyperdx/api': patch
'@hyperdx/app': patch
---
fix: getLogBatchGroupedByBody missing return bug (regression)

View file

@ -1694,6 +1694,9 @@ export const getLogBatchGroupedByBody = async ({
span.end();
},
);
// @ts-ignore
return result;
};
export const getLogBatch = async ({

View file

@ -109,12 +109,10 @@ router.get('/patterns', isUserAuthenticated, async (req, res, next) => {
teamId: teamId.toString(),
});
// @ts-expect-error
if (logs.data.length === 0) {
return res.json({ data: [] });
}
// @ts-expect-error
// use the 1st id as the representative id
const lines = logs.data.map(log => [log.ids[0], log.body]);
// TODO: separate patterns by service
@ -136,7 +134,6 @@ router.get('/patterns', isUserAuthenticated, async (req, res, next) => {
trends: Record<string, number>;
}
> = {};
// @ts-expect-error
for (const log of logs.data) {
const patternId = logsPatternsData.result[log.ids[0]];
if (patternId) {