From 5e8ad3bcb1c0b612fcd4804f54f8ef936c7db0cb Mon Sep 17 00:00:00 2001 From: Manan Vaghasiya Date: Mon, 15 Jul 2024 14:34:06 +0000 Subject: [PATCH] use enum for status counts --- .../apps/dashboard/src/queries/posture.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deepfence_frontend/apps/dashboard/src/queries/posture.tsx b/deepfence_frontend/apps/dashboard/src/queries/posture.tsx index 142da3d460..4d89befec1 100644 --- a/deepfence_frontend/apps/dashboard/src/queries/posture.tsx +++ b/deepfence_frontend/apps/dashboard/src/queries/posture.tsx @@ -524,11 +524,12 @@ export const postureQueries = createQueryKeys('posture', { ); const cloudComplianceStatus = { - alarm: result.value.status_counts?.['alarm'] ?? 0, - info: result.value.status_counts?.['info'] ?? 0, - ok: result.value.status_counts?.['ok'] ?? 0, - skip: result.value.status_counts?.['skip'] ?? 0, - delete: result.value.status_counts?.['delete'] ?? 0, + alarm: result.value.status_counts?.[ModelCloudComplianceStatusEnum.Alarm] ?? 0, + info: result.value.status_counts?.[ModelCloudComplianceStatusEnum.Info] ?? 0, + ok: result.value.status_counts?.[ModelCloudComplianceStatusEnum.Ok] ?? 0, + skip: result.value.status_counts?.[ModelCloudComplianceStatusEnum.Skip] ?? 0, + delete: + result.value.status_counts?.[ModelCloudComplianceStatusEnum.Delete] ?? 0, }; return {