/
index.ts
45 lines (41 loc) · 1.03 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';
const path = 'sync-plaid/:userId?publicToken=:publicToken';
export function useMethod({ pathParameters, body }: any) {
console.log(pathParameters);
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}
const parameters: Parameter[] = [
{
key: 1,
name: 'userId',
description: 'User ID',
required: 'yes',
default: '',
dataType: 'string',
},
{
key: 2,
name: 'publicToken',
description: 'Public Token',
required: 'yes',
default: '',
dataType: 'string',
},
];
export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description:
'Send Public Token to be exchanged for access token and to sync plaid data with user accounts',
name: path,
method: 'GET',
parameters,
};