Skip to content

Commit

Permalink
test: fix suite
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Oct 21, 2022
1 parent 1924ea7 commit 4483454
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,9 @@ export class Item {
```typescript
import { Request, Response } from 'express';

import {
parseQuery,
Parameter,
ParseOutput
} from 'rapiq';

import {
applyQueryParseOutput,
parseQuery,
useDataSource
} from 'typeorm-extension';

Expand All @@ -259,7 +254,7 @@ import {
export async function getUsers(req: Request, res: Response) {
// const {fields, filter, include, page, sort} = req.query;

const output: ParseOutput = parseQuery<User>(req.query, {
const output = parseQuery<User>(req.query, {
defaultPath: 'user',
fields: {
allowed: ['id', 'name', 'realm.id', 'realm.name'],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/parse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('src/parse.ts', () => {
});

it('should parse relation query parameter', () => {
let value = parseQueryParameter(Parameter.RELATIONS, 'profile', { allowed: ['profile'] });
let value = parseQueryParameter<Parameter.RELATIONS, Record<string, any>>(Parameter.RELATIONS, 'profile', { allowed: ['profile'] });
expect(value).toEqual([
{ key: 'profile', value: 'profile' },
] as RelationsParseOutput);
Expand Down

0 comments on commit 4483454

Please sign in to comment.