Open yackinn opened 2 years ago
Your model doesn't seem to have Date or object data types, where do they come from?
@Entity({ abstract: true })
export abstract class OmputBaseEntity {
@PrimaryKey()
id: string = v4();
@Property({ hidden: true })
createdAt: Date = new Date();
@Property({ hidden: true, nullable: true, onUpdate: () => new Date() })
updatedAt?: Date;
@dziraf That's what the base entity looks like. Are the types incorrect for adminjs?
Transferring to adminjs-mikroorm
repository. The types might be correct but they need to be mapped for a specific ORM adapter. I'm not sure why MikroORM uses Javascript types for columns now while it used database types previously e. g. timestamptz
so I'll have to take a look.
You should be able to set a specific type in your resource options for each property in the meantime
Similar to ArrayType . For fixing date type, I can do a pr
let type: PropertyType = DATA_TYPES[this.column.columnTypes[0].toLowerCase()]
|| DATA_TYPES[this.column.type.toLowerCase()];
This should fix for date. I just checked locally
@rubiin Go ahead. Unfortuantely I don't have any active project with MikroORM at the moment to investigate those issues. We do have a dev repo: https://github.com/SoftwareBrothers/adminjs-dev but it would still require a lot of work to reproduce various ORM-specific types. I personally prefer if ORMs provide database types since it's easier to map across packages
What about this issue? I also have plenty of errors like that (only with Date).
adminjs 5.10.0
@adminjs/mikroorm 1.1.1
[EDIT] The solution proposed by @rubiin works like a charm in my case.
Still no PR?
Describe the bug We can see a lot of unhandled type warnigns in the terminal output on load of any resource in the admin panel.
Installed libraries and their versions "@adminjs/express": "^4.1.0" "@adminjs/mikroorm": "^1.1.0" "@adminjs/nestjs": "^4.0.0" "@mikro-orm/core": "^5.0.5"
To Reproduce Steps to reproduce the behavior:
Expected behavior No unhandled type warning.
Screenshots That's the console output.
AdminJSOptions with schema
Desktop (please complete the following information if relevant):
Additional context Add any other context about the problem here. That's our module setup using Nestjs.