Skip to content

Commit

Permalink
Afdd datatype to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
gabitanalla committed Apr 16, 2022
1 parent 17386c6 commit aeb3965
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/common/components/rest-method/rest-method.tsx
Expand Up @@ -48,7 +48,8 @@ export const RestMethod = ({
};

const onValueChange = (key: string, value: string) => {
setCustomParameters({ ...customParameters, [key]: value });
const parameter = parameters.filter(parameter => parameter['name'] = key)
setCustomParameters({ ...customParameters, [key]: parameter.dataType == 'string' ? value : Number(value)});
};

const onValuePathChange = (key: string, value: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/index.ts
Expand Up @@ -17,7 +17,7 @@ export interface Parameter {
required: 'yes' | 'no';
description: string;
default: string;
dataType?: string;
dataType: 'string' | 'number';
}

export interface MethodMetadata {
Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/get-plaid-access-token/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/get-plaid-account/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/get-plaid-link-token/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { Headers } from '../../../helpers/axios';
import { useRestCall } from '../../../helpers/rest-calls';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/get-plaid-transaction/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/list-plaid-accounts/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/list-plaid-transactions/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/save-plaid-accounts/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down
2 changes: 1 addition & 1 deletion src/common/rest/plaid/save-plaid-transactions/index.ts
@@ -1,4 +1,4 @@
import { MethodMetadata, Parameter } from '..';
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

Expand Down

0 comments on commit aeb3965

Please sign in to comment.