aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-14 09:46:54 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-14 09:46:54 +0800
commitdd7e03c7d7434e5fd5aa96812e773a69247b8546 (patch)
treec4df8caae238955ca495a6f7738f66011fb17827 /packages/sra-api/src
parent3b0fa1aa87841cd61e8daf9df682ac1bb4cafaa0 (diff)
downloaddexon-sol-tools-dd7e03c7d7434e5fd5aa96812e773a69247b8546.tar.gz
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.ts5
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];
};