From e2bff569d49b8a740721f007a8ef441b3d82767b Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 20 Mar 2024 10:42:07 -0600 Subject: [PATCH] use right api, parse int --- src/libs/API/types.ts | 2 +- .../workflows/WorkspaceAutoReportingFrequencyPage.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index c04702f38f6a..e6db0a901696 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -10,7 +10,7 @@ type ApiRequest = ValueOf; const WRITE_COMMANDS = { SET_WORKSPACE_AUTO_REPORTING: 'SetWorkspaceAutoReporting', SET_WORKSPACE_AUTO_REPORTING_FREQUENCY: 'SetWorkspaceAutoReportingFrequency', - SET_WORKSPACE_AUTO_REPORTING_MONTHLY_OFFSET: 'UpdatePolicy', + SET_WORKSPACE_AUTO_REPORTING_MONTHLY_OFFSET: 'SetWorkspaceAutoReportingOffset', SET_WORKSPACE_APPROVAL_MODE: 'SetWorkspaceApprovalMode', SET_WORKSPACE_PAYER: 'SetWorkspacePayer', SET_WORKSPACE_REIMBURSEMENT: 'SetWorkspaceReimbursement', diff --git a/src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx b/src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx index 901541a94a85..9f9feb787211 100644 --- a/src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx @@ -79,6 +79,9 @@ function WorkspaceAutoReportingFrequencyPage({policy, route}: WorkspaceAutoRepor if (typeof policy?.autoReportingOffset === 'number') { return toLocaleOrdinal(policy.autoReportingOffset); } + if (typeof policy?.autoReportingOffset === 'string' && parseInt(policy?.autoReportingOffset, 10)) { + return toLocaleOrdinal(parseInt(policy.autoReportingOffset, 10)); + } return translate(`workflowsPage.frequencies.${policy?.autoReportingOffset}`); };