Skip to content

Commit

Permalink
[ResponseOps]]MaintenaceWindow] Increase MW table limit to 1k (#198504)
Browse files Browse the repository at this point in the history
Here in this PR I am increasing the limit for MW to 1K.
Even I've changed schema for query params(deleted maybe) I did not add
additional tests, because we already have one integration test for the
case, when we do not have `page` and `per_page` params.
  • Loading branch information
guskovaue authored Oct 31, 2024
1 parent 76ccc9c commit 3413cbb
Showing 1 changed file with 18 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,24 @@ const MAX_DOCS = 10000;

export const findMaintenanceWindowsRequestQuerySchema = schema.object(
{
page: schema.maybe(
schema.number({
defaultValue: 1,
min: 1,
max: MAX_DOCS,
meta: {
description: 'The page number to return.',
},
})
),
per_page: schema.maybe(
schema.number({
defaultValue: 20,
min: 0,
max: 100,
meta: {
description: 'The number of maintenance windows to return per page.',
},
})
),
// we do not need to use schema.maybe here, because if we do not pass property page, defaultValue will be used
page: schema.number({
defaultValue: 1,
min: 1,
max: MAX_DOCS,
meta: {
description: 'The page number to return.',
},
}),
// we do not need to use schema.maybe here, because if we do not pass property per_page, defaultValue will be used
per_page: schema.number({
defaultValue: 1000,
min: 0,
max: 100,
meta: {
description: 'The number of maintenance windows to return per page.',
},
}),
},
{
validate: (params) => {
Expand Down

0 comments on commit 3413cbb

Please sign in to comment.