Skip to content

Rewrite FilterQuery #264

@jpahm

Description

@jpahm

The FilterQuery function, found in /schema/filter.go has had its code commented out for a little while now, since its original functionality did not work as intended.

This function should be rewritten to do the following:

  • Take in a generic type to filter a query by (currently this is denoted by F)
  • Take in a gin context (currently denoted c)
  • Use reflection to read the field tags of type F
  • Filter out any parameters given in c that do not match a field in F with the tag queryable

Keep in mind that this will also need to check for fields in nested structs, since queries using dot notation (i.e. academic_session.name) are allowed!

These changes will coincide with a separate issue to add the queryable tag to type fields where appropriate.

Metadata

Metadata

Assignees

Labels

L2A task suitable for someone who is comfortable implementing features.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions