From c543a4a9fa809de823138278d7e1c3beb6e84998 Mon Sep 17 00:00:00 2001 From: Josh Ouyang Date: Mon, 18 Jan 2021 18:18:58 +0800 Subject: [PATCH] fix: fetched incorrect scheduled task runs page (#384) --- .../deployedTaskDetail/effects.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/kun-frontend/src/rematch/models/operationCenter/deployedTaskDetail/effects.ts b/kun-frontend/src/rematch/models/operationCenter/deployedTaskDetail/effects.ts index a4266c4f0..460f0e4cb 100644 --- a/kun-frontend/src/rematch/models/operationCenter/deployedTaskDetail/effects.ts +++ b/kun-frontend/src/rematch/models/operationCenter/deployedTaskDetail/effects.ts @@ -1,5 +1,8 @@ import { RootDispatch } from '@/rematch/store'; -import { fetchDeployedTaskDetail, fetchTaskRunsOfDeployedTask } from '@/services/task-deployments/deployed-tasks'; +import { + fetchDeployedTaskDetail, + fetchTaskRunsOfDeployedTask, +} from '@/services/task-deployments/deployed-tasks'; import { TaskRunListFilter } from '@/rematch/models/operationCenter/deployedTaskDetail/model-state'; import moment from 'moment'; @@ -19,17 +22,20 @@ export const effects = (dispatch: RootDispatch) => ({ const respData = await fetchTaskRunsOfDeployedTask({ id: payload.id, pageSize: payload.pageSize || 25, - pageNumber: payload.pageNum || 1, + // @ts-ignore + pageNum: payload.pageNum || 1, status: payload.status || undefined, - startTime: payload.startTime ? moment(payload.startTime).toISOString() : undefined, - endTime: payload.endTime ? moment(payload.endTime).toISOString() : undefined, + startTime: payload.startTime + ? moment(payload.startTime).toISOString() + : undefined, + endTime: payload.endTime + ? moment(payload.endTime).toISOString() + : undefined, }); if (respData && respData.records) { dispatch.deployedTaskDetail.setTaskRunsCount(respData.totalCount); dispatch.deployedTaskDetail.setTaskRuns(respData.records); } - } catch (e) { - - } + } catch (e) {} }, });