Просмотр исходного кода

refactor(stats-reporting): simplify countValue assignment and formatting in getAdTypeClicks method

Dave 1 месяц назад
Родитель
Сommit
c40d942634

+ 3 - 5
apps/box-stats-api/src/feature/stats-reporting/stats-reporting.service.ts

@@ -301,15 +301,13 @@ export class StatsReportingService {
     ]);
 
     const countValue =
-      Array.isArray(countRows) && countRows.length > 0
-        ? countRows[0].total
-        : 0;
+      Array.isArray(countRows) && countRows.length > 0 ? countRows[0].total : 0;
     const total =
       typeof countValue === 'bigint'
         ? Number(countValue)
         : typeof countValue === 'number'
-        ? countValue
-        : 0;
+          ? countValue
+          : 0;
 
     const normalizedItems = (items ?? []).map((item) => ({
       channelId: item.channelId ?? '',