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

Errors when using bigint as id #9

Open
CJEnright opened this issue Apr 17, 2022 · 0 comments
Open

Errors when using bigint as id #9

CJEnright opened this issue Apr 17, 2022 · 0 comments

Comments

@CJEnright
Copy link

When using bigints as resource ids a type error is thrown

TypeError: _d.call is not a function
    at node_modules/@adminjs/logger/lib/log.action.js:55:178
    at node_modules/adminjs/lib/backend/decorators/action/action-decorator.js:147:99

Looks like it's due to this line:

const recordId =
        params.recordId ||
        (typeof record?.params?.id === 'string'
          ? record?.params?.id
          : record?.params?.id?.());

Are there any concerns with changing that to be this?

const recordId = params.recordId || record?.params?.id;

I tested this change using prisma as my adapter and didn't notice any issues, however I'm a little hesitant as I haven't been able to tell exactly what record?.params?.id?.() is supposed to do. As far as I can tell record.params is just an object, so I don't think the id() function should exist on it.

If this change looks alright I can open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant