Skip to content

Commit

Permalink
use right api, parse int
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Mar 20, 2024
1 parent 99169e1 commit e2bff56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ApiRequest = ValueOf<typeof CONST.API_REQUEST_TYPE>;
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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
};
Expand Down

0 comments on commit e2bff56

Please sign in to comment.