Browse Source

feat: add shuffleParam

pull/2558/head
Wing-Kam Wong 2 years ago
parent
commit
3bbe061949
  1. 13
      packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts
  2. 9
      packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts

13
packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts

@ -74,6 +74,19 @@ export const offsetParam = {
example: 0
};
export const shuffleParam = {
schema: {
type: 'number',
minimum: 0,
maximum: 1
},
in: 'query',
name: 'shuffle',
description:
'The `shuffle` parameter used for pagination, the response will be shuffled if it is set to 1.',
example: 0
};
export const columnNameQueryParam = {
schema: {
type: 'string'

9
packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts

@ -8,6 +8,7 @@ import {
getNestedParams,
limitParam,
offsetParam,
shuffleParam,
referencedRowIdParam,
relationTypeParam,
rowIdParam,
@ -35,6 +36,7 @@ export const getModelPaths = async (ctx: {
sortParam,
whereParam,
limitParam,
shuffleParam,
offsetParam,
...(await getNestedParams(ctx.columns))
],
@ -198,6 +200,7 @@ export const getModelPaths = async (ctx: {
sortParam,
whereParam,
limitParam,
shuffleParam,
offsetParam
],
responses: {
@ -375,7 +378,7 @@ export const getModelPaths = async (ctx: {
}
},
tags: [ctx.tableName],
parameters: [limitParam, offsetParam]
parameters: [limitParam, offsetParam, shuffleParam]
}
},
[`/api/v1/db/data/${ctx.orgs}/${ctx.projectName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]: {
@ -399,7 +402,7 @@ export const getModelPaths = async (ctx: {
}
},
tags: [ctx.tableName],
parameters: [limitParam, offsetParam],
parameters: [limitParam, offsetParam, shuffleParam],
description: ''
},
delete: {
@ -439,7 +442,7 @@ export const getModelPaths = async (ctx: {
}
},
tags: [ctx.tableName],
parameters: [limitParam, offsetParam]
parameters: [limitParam, offsetParam, shuffleParam]
}
}
}

Loading…
Cancel
Save