Merge branch 'fix/production-result' into 'development'

[FIX/FE] Production Result

See merge request mbugroup/lti-web-client!239
This commit is contained in:
Rivaldi A N S
2026-01-23 08:37:32 +00:00
+19 -17
View File
@@ -32,21 +32,21 @@ export class ProductionResultReportApiService extends BaseApiService<
const mappedProductionResults: { const mappedProductionResults: {
projectFlockKandang: BaseProjectFlockKandang; projectFlockKandang: BaseProjectFlockKandang;
productionResult: ProductionResult[] | null; productionResult: ProductionResult[] | null;
}[] = []; }[] = await Promise.all(
(projectFlockKandangs || []).map(async (projectFlockKandang) => {
const getProductionResultPath = `${this.basePath}/${projectFlockKandang.id}?page=1&limit=99999999`;
const getProductionResultRes = await httpClient<
BaseApiResponse<ProductionResult[]>
>(getProductionResultPath);
projectFlockKandangs?.forEach(async (projectFlockKandang) => { return {
const getProductionResultPath = `${this.basePath}/${projectFlockKandang.id}?page=1&limit=99999999`; projectFlockKandang,
const getProductionResultRes = await httpClient< productionResult: isResponseSuccess(getProductionResultRes)
BaseApiResponse<ProductionResult[]> ? getProductionResultRes.data
>(getProductionResultPath); : null,
};
mappedProductionResults.push({ })
projectFlockKandang, );
productionResult: isResponseSuccess(getProductionResultRes)
? getProductionResultRes.data
: null,
});
});
const rows = mappedProductionResults; const rows = mappedProductionResults;
if (!rows || rows.length === 0) { if (!rows || rows.length === 0) {
@@ -103,9 +103,11 @@ export class ProductionResultReportApiService extends BaseApiService<
fcr_std: productionResult.fcr_std, fcr_std: productionResult.fcr_std,
hh: productionResult.hh, hh: productionResult.hh,
hh_std: productionResult.hh_std, hh_std: productionResult.hh_std,
project_flock_name: productionResult.project_flock.name, project_flock_name:
project_flock_category: productionResult.project_flock.category, row.projectFlockKandang.project_flock.flock_name,
kandang_name: productionResult.project_flock.kandang.name, project_flock_category:
row.projectFlockKandang.project_flock.category,
kandang_name: row.projectFlockKandang.kandang.name,
created_at: formatDate(productionResult.created_at, 'YYYY-MM-DD'), created_at: formatDate(productionResult.created_at, 'YYYY-MM-DD'),
updated_at: formatDate(productionResult.updated_at, 'YYYY-MM-DD'), updated_at: formatDate(productionResult.updated_at, 'YYYY-MM-DD'),
}); });