(ui): Update UI to use the user selected duration

This commit is contained in:
Ken Hibino
2021-12-01 17:14:26 -08:00
parent ce28af6a69
commit 3a90416b52
5 changed files with 23 additions and 14 deletions

View File

@@ -27,11 +27,11 @@ export type MetricsActionTypes =
| GetMetricsSuccessAction
| GetMetricsErrorAction;
export function getMetricsAsync() {
export function getMetricsAsync(endTime: number, duration: number) {
return async (dispatch: Dispatch<MetricsActionTypes>) => {
dispatch({ type: GET_METRICS_BEGIN });
try {
const response = await getMetrics();
const response = await getMetrics(endTime, duration);
dispatch({ type: GET_METRICS_SUCCESS, payload: response });
} catch (error) {
console.error(`getMetricsAsync: ${toErrorStringWithHttpStatus(error)}`);