Skip to content
New issue

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

[feat] How can I use custom filters in before list hook? #1564

Open
radekdp opened this issue Sep 25, 2023 · 0 comments
Open

[feat] How can I use custom filters in before list hook? #1564

radekdp opened this issue Sep 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@radekdp
Copy link

radekdp commented Sep 25, 2023

Contact Details

No response

What happened?

Hi,
I need add custom filter rule in my before function (list hook):

request.query = {
    ...query,
    ['filters.role']: 'admin',
    ['filters.storeId']: In([1, 2]),
  };
  

but not working typeorm function IN(), it's possible to do that?

Bug prevalence

every time

AdminJS dependencies version

{
"@adminjs/design-system": "^4.0.3",
"@adminjs/express": "^6.0.1",
"@adminjs/import-export": "^3.0.0",
"@adminjs/nestjs": "^6.0.1",
"@adminjs/themes": "^1.0.1",
"@adminjs/typeorm": "^5.0.0",
"@chirpstack/chirpstack-api": "^4.4.0",
"@nestjs/common": "^10.2.6",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.6",
"@nestjs/microservices": "^10.2.6",
"@nestjs/platform-express": "^10.2.6",
"@nestjs/typeorm": "^10.0.0",
"adminjs": "^7.2.2",
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"cpx": "^1.5.0",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.10",
"eslint-plugin-legacy-decorators": "^1.0.0",
"express-formidable": "^1.2.0",
"express-session": "^1.17.3",
"json-rules-engine": "^6.4.2",
"mqtt": "^4.3.7",
"pg": "^8.11.3",
"postgresql": "0.0.1",
"react-bootstrap": "2.8.0",
"recharts": "^2.8.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"typeorm": "^0.3.12"
}

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant