We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// user.controller.ts import { Controller } from '@nestjs/common'; import { ApiUseTags } from '@nestjs/swagger'; import { Crud, CrudController } from '@nestjsx/crud'; import { User } from './user.entity'; import { UsersService } from './users.service'; @Crud({ model: { type: User, } }) @ApiUseTags('users') @Controller('/users') export class UsersController implements CrudController<User> { constructor(public service: UsersService) {} }
// user.entity.ts import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm'; @Entity('users') export class User { @PrimaryGeneratedColumn() id:number; @Column() name: string; @Column() score:number; }
// user.service.ts import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { TypeOrmCrudService } from '@nestjsx/crud-typeorm'; import { User } from './user.entity'; @Injectable() export class UsersService extends TypeOrmCrudService<User> { constructor(@InjectRepository(User) repo) { super(repo); } }
Open http://localhost:3000/users?filter=score||eq||0
The text was updated successfully, but these errors were encountered:
crud/packages/crud-request/src/request-query.parser.ts
Line 157 in 35acb44
The cause is JSON.parse (), because, ?filter=score||eq||"0" works perfectly. I believe converting the returned value to string solves the problem.
?filter=score||eq||"0"
Sorry, something went wrong.
Diluka
Successfully merging a pull request may close this issue.
Open http://localhost:3000/users?filter=score||eq||0
The text was updated successfully, but these errors were encountered: