Skip to content

Commit

Permalink
fix parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Mar 12, 2024
1 parent 6903cb5 commit d461d15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/libs/API/parameters/CreatePolicyTaxParams.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type {TaxRate} from '@src/types/onyx/Policy';

type CreatePolicyTaxParams = {
policyID: string;
taxFields: Pick<TaxRate, 'name' | 'value'> & {
enabled: true;
taxCode: string;
};
taxFields: string;
};

export default CreatePolicyTaxParams;
13 changes: 8 additions & 5 deletions src/libs/actions/TaxRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ function createWorkspaceTax(policyID: string, taxRate: TaxRate) {

const parameters = {
policyID,
taxFields: {
...taxRate,
enabled: true,
taxCode: taxRate.code,
},
taxFields: JSON.stringify([
{
name: taxRate.name,
value: taxRate.value,
enabled: true,
taxCode: taxRate.code,
},
]),
} satisfies CreatePolicyTaxParams;

API.write(WRITE_COMMANDS.CREATE_POLICY_TAX, parameters, onyxData);
Expand Down

0 comments on commit d461d15

Please sign in to comment.