Skip to content

Bug: eq filter on columns of type array will cause a 500 even though it's disabled by config #1109

@dariozachow

Description

@dariozachow

when having a column of type array e.g:

  @Column('int', { nullable: true, array: true, name: 'list' })
  list: number[];

paginated with the following config:

export const config = {
  relativePath: false,
  maxLimit: 1000,
  filterableColumns: {
    'list': [FilterOperator.CONTAINS],
  },
  origin: process.env.API_HOST,
  defaultLimit: 100,
  defaultSortBy: [['created', 'DESC']]
} satisfies PaginateConfig<Entity>;

In the swagger UI only $and, $or and $contains are shown as example values. Though when sending $eq:1 as the filter in the request, the API will return a 500 Error because the query fails with the following Error: "QueryFailedError: malformed array literal: "1".
Maybe this should be an 400 because it is not really a valid value or just ignore the entire part for the filters?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions