mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'fix/production-result' into 'development'
[FIX/FE] Production Result See merge request mbugroup/lti-web-client!239
This commit is contained in:
@@ -32,21 +32,21 @@ export class ProductionResultReportApiService extends BaseApiService<
|
||||
const mappedProductionResults: {
|
||||
projectFlockKandang: BaseProjectFlockKandang;
|
||||
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) => {
|
||||
const getProductionResultPath = `${this.basePath}/${projectFlockKandang.id}?page=1&limit=99999999`;
|
||||
const getProductionResultRes = await httpClient<
|
||||
BaseApiResponse<ProductionResult[]>
|
||||
>(getProductionResultPath);
|
||||
|
||||
mappedProductionResults.push({
|
||||
projectFlockKandang,
|
||||
productionResult: isResponseSuccess(getProductionResultRes)
|
||||
? getProductionResultRes.data
|
||||
: null,
|
||||
});
|
||||
});
|
||||
return {
|
||||
projectFlockKandang,
|
||||
productionResult: isResponseSuccess(getProductionResultRes)
|
||||
? getProductionResultRes.data
|
||||
: null,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
const rows = mappedProductionResults;
|
||||
if (!rows || rows.length === 0) {
|
||||
@@ -103,9 +103,11 @@ export class ProductionResultReportApiService extends BaseApiService<
|
||||
fcr_std: productionResult.fcr_std,
|
||||
hh: productionResult.hh,
|
||||
hh_std: productionResult.hh_std,
|
||||
project_flock_name: productionResult.project_flock.name,
|
||||
project_flock_category: productionResult.project_flock.category,
|
||||
kandang_name: productionResult.project_flock.kandang.name,
|
||||
project_flock_name:
|
||||
row.projectFlockKandang.project_flock.flock_name,
|
||||
project_flock_category:
|
||||
row.projectFlockKandang.project_flock.category,
|
||||
kandang_name: row.projectFlockKandang.kandang.name,
|
||||
created_at: formatDate(productionResult.created_at, 'YYYY-MM-DD'),
|
||||
updated_at: formatDate(productionResult.updated_at, 'YYYY-MM-DD'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user