fix: app monthly usage details error (#1761)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled

This commit is contained in:
Daniel Salazar
2025-10-16 00:50:05 -07:00
committed by GitHub
parent 61fbc45e3c
commit 15b65dab7d
@@ -169,16 +169,16 @@ export class MeteringAndBillingService {
const appId = actor.type?.app?.uid;
if ( appTotals && appId ) {
const filteredAppTotals: Record<string, UsageByType> = {};
let othersTotal: UsageByType | null = null;
let othersTotal: UsageByType = {} as UsageByType;
Object.entries(appTotals).forEach(([appKey, appUsage]) => {
if ( appKey === appId ) {
filteredAppTotals[appKey] = appUsage;
} else {
Object.entries(appUsage).forEach(([usageKind, amount]) => {
if ( !othersTotal![usageKind] ) {
othersTotal![usageKind] = 0;
if ( !othersTotal[usageKind] ) {
othersTotal[usageKind] = 0;
}
othersTotal![usageKind] += amount;
othersTotal[usageKind] += amount;
});
}
});