Skip to content

Commit

Permalink
Addressing PR comments 2
Browse files Browse the repository at this point in the history
  • Loading branch information
adcoelho committed Jul 5, 2023
1 parent 7c1ebf9 commit a297f3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/common/schema/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('schema', () => {
`);
});

it('fails when page > maxPerPage', () => {
it('fails when perPage > maxPerPage', () => {
expect(PathReporter.report(paginationSchema({ maxPerPage: 3 }).decode({ perPage: 4 })))
.toMatchInlineSnapshot(`
Array [
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/common/schema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { NumberFromString } from '../api/saved_object';
const PageTypeRt = rt.union([rt.number, NumberFromString]);
type PageNumberType = rt.TypeOf<typeof PageTypeRt>;

export interface PaginationType {
export interface Pagination {
page: PageNumberType;
perPage: PageNumberType;
}

export const PaginationSchemaRt = rt.exact(rt.partial({ page: PageTypeRt, perPage: PageTypeRt }));
export type PartialPaginationType = Partial<PaginationType>;
export type PartialPaginationType = Partial<Pagination>;

0 comments on commit a297f3f

Please sign in to comment.