Vercel/src/admin/insights/server.ts
2025-03-01 13:00:43 -06:00

24 lines
573 B
TypeScript

import { getOutdatedPhotosCount } from '@/photo/db/query';
import {
getSignificantInsights,
indicatorStatusForSignificantInsights,
} from '.';
import { getGitHubMetaForCurrentApp } from '.';
export const getInsightsIndicatorStatus = async () => {
const [
codeMeta,
photosCountOutdated,
] = await Promise.all([
getGitHubMetaForCurrentApp(),
getOutdatedPhotosCount(),
]);
const significantInsights = getSignificantInsights({
codeMeta,
photosCountOutdated,
});
return indicatorStatusForSignificantInsights(significantInsights);
};