diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-14 09:46:54 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-14 09:46:54 +0800 |
commit | dd7e03c7d7434e5fd5aa96812e773a69247b8546 (patch) | |
tree | c4df8caae238955ca495a6f7738f66011fb17827 /packages/sra-api/src | |
parent | 3b0fa1aa87841cd61e8daf9df682ac1bb4cafaa0 (diff) | |
download | dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.gz dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.bz2 dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.lz dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.xz dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.zst dexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.zip |
Add defaults for networkId and pagination
Diffstat (limited to 'packages/sra-api/src')
-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]; }; |