feat(MED-131): update analyses on package logic

This commit is contained in:
2025-08-04 11:55:23 +03:00
parent c02cb046a5
commit 7c3aa45ec7
9 changed files with 88 additions and 51 deletions

View File

@@ -85,20 +85,6 @@ export const listProducts = async ({
})
}
export const getAnalysisElementOriginalIds = async (products: HttpTypes.StoreProduct[]) => {
return products
.flatMap(({ metadata }) => {
const value = metadata?.analysisElementOriginalIds;
try {
return JSON.parse(value as string);
} catch (e) {
console.error("Failed to parse analysisElementOriginalIds from analysis package, possibly invalid format", e);
return [];
}
})
.filter(Boolean) as string[];
}
/**
* This will fetch 100 products to the Next.js cache and sort them based on the sortBy parameter.
* It will then return the paginated products based on the page and limit parameters.