Skip to content

Errors when using bigint as id #9

@CJEnright

Description

@CJEnright

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions