diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-08-14 14:05:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 14:05:37 +0800 |
commit | 56eb444ea4b04768c8ea3192d87074602838f0ea (patch) | |
tree | e7b173c3d2985c38fa0e87dcb67dae5d8e07a79c /packages/sra-api/src/parameters.ts | |
parent | fadd292ecf367e42154856509d0ea0c20b23f2f1 (diff) | |
parent | 228387f995bbe8ab52822072dd513a0f7898d8f8 (diff) | |
download | dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar.gz dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar.bz2 dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar.lz dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar.xz dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.tar.zst dexon-sol-tools-56eb444ea4b04768c8ea3192d87074602838f0ea.zip |
Merge pull request #964 from 0xProject/feature/sra-api/add-defaults
[sra-api] Add defaults for networkId and pagination
Diffstat (limited to 'packages/sra-api/src/parameters.ts')
-rw-r--r-- | packages/sra-api/src/parameters.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/sra-api/src/parameters.ts b/packages/sra-api/src/parameters.ts index 10382894c..48ffb036d 100644 --- a/packages/sra-api/src/parameters.ts +++ b/packages/sra-api/src/parameters.ts @@ -7,6 +7,7 @@ export const paginationParameters: ParameterObject[] = [ example: 3, schema: { type: 'number', + default: 1, }, }, { @@ -16,6 +17,7 @@ export const paginationParameters: ParameterObject[] = [ example: 10, schema: { type: 'number', + default: 100, }, }, ]; @@ -27,10 +29,11 @@ export const networkdIdParameter: ParameterObject = { example: 42, schema: { type: 'number', + default: 1, }, }; export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => { const optionalParameters = isPaginated ? paginationParameters : []; - return [networkdIdParameter, ...optionalParameters, ...parameters]; + return [...parameters, networkdIdParameter, ...optionalParameters]; }; |