Skip to content

Commit

Permalink
feat(#9241): add REST endpoint /api/v1/people to get people
Browse files Browse the repository at this point in the history
  • Loading branch information
sugat009 committed Aug 8, 2024
1 parent c79c935 commit ae39df7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shared-libs/cht-datasource/src/person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LocalDataContext } from './local/libs/data-context';
import { RemoteDataContext } from './remote/libs/data-context';
import { InvalidArgumentError } from './libs/error';
import { Page } from './libs/core';
import { InvalidArgumentError } from './libs/error';

/** */
export namespace v1 {
Expand Down Expand Up @@ -48,9 +49,9 @@ export namespace v1 {
}
};

const assertSkip = (skip: unknown) => {
if (typeof skip !== 'number' || !Number.isInteger(skip) || skip < 0) {
throw new InvalidArgumentError(`The skip must be a non-negative number: [${String(skip)}]`);
const assertCursor = (cursor: unknown) => {
if (typeof cursor !== 'string' || Number(cursor) < 0) {
throw new InvalidArgumentError(`The cursor must be a stringified non-negative number: [${String(cursor)}]`);
}
};

Expand Down

0 comments on commit ae39df7

Please sign in to comment.