From 4483454b6fa51f0696c80fcf1a7364fc0f501933 Mon Sep 17 00:00:00 2001 From: tada5hi Date: Fri, 21 Oct 2022 11:22:19 +0200 Subject: [PATCH] test: fix suite --- README.MD | 9 ++------- test/unit/parse.spec.ts | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.MD b/README.MD index 1e3854b5..90ee168e 100644 --- a/README.MD +++ b/README.MD @@ -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'; @@ -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(req.query, { + const output = parseQuery(req.query, { defaultPath: 'user', fields: { allowed: ['id', 'name', 'realm.id', 'realm.name'], diff --git a/test/unit/parse.spec.ts b/test/unit/parse.spec.ts index b7350a65..d916e1a7 100644 --- a/test/unit/parse.spec.ts +++ b/test/unit/parse.spec.ts @@ -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, 'profile', { allowed: ['profile'] }); expect(value).toEqual([ { key: 'profile', value: 'profile' }, ] as RelationsParseOutput);