'@admin-bro/nestjs with @admin-bro/sequelize and mysql ? Getting Error NoResourceAdapterError
Facing same issue with '@admin-bro/sequelize' NoResourceAdapterError: There are no adapters supporting one of the resource you provided
import { Database, Resource } from '@admin-bro/sequelize';
import { AdminModule } from '@admin-bro/nestjs';
AdminBro.registerAdapter({ Database, Resource });
SequelizeModule.forRoot({
dialect: 'mysql',
host: process.env.DATABASE_HOST,
port: +process.env.DATABASE_PORT,
username: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
models: [__dirname + '/**/*.model.ts'],
logging: console.log
}),
AdminModule.createAdmin({ adminBroOptions: { rootPath: '/admin', resources: [{ resource: User, options: {} }], } }),
@Table({
modelName: 'user',
timestamps: false
})
export class User extends Model {
}
Solution 1:[1]
This case can be fixed by below answer. It was an issue that the entity had to extends 'BaseEntity' to use it in admin bro.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Moure Dievarse |
