@@ -22,8 +22,9 @@ Then we have to define `Log` entity - the place we will track changes. Below yo
2222{% tab title="Sequelize" %}
2323``` typescript
2424import { DataTypes , Model } from ' sequelize' ;
25- import db from ' ./sequelize.connection' ;
26- import User from ' ./user.entity' ;
25+
26+ import db from ' ./sequelize.connection.js' ;
27+ import User from ' ./user.entity.js' ;
2728
2829export interface ILog = {
2930 id: number ;
@@ -224,7 +225,7 @@ export const LogModel = model<Log>('Log', LogSchema);
224225
225226{% tab title="ObjectionJS" %}
226227``` typescript
227- import { BaseModel } from ' ../utils/base-model' ;
228+ import { BaseModel } from ' ../utils/base-model.js ' ;
228229
229230class Log extends BaseModel {
230231 id: number ;
@@ -286,12 +287,15 @@ To get logger to work, add extra property to resource config. Below you can find
286287
287288``` javascript
288289import loggerFeature from ' @adminjs/logger' ;
289- import ResourceModel from ' ./resource.entity' ;
290+
291+ import ResourceModel from ' ./resource.entity.js' ;
292+ import componentLoader from ' ./component-loader.js' ;
290293
291294export default {
292295 resource: ResourceModel,
293296 features: [
294297 loggerFeature ({
298+ componentLoader,
295299 propertiesMapping: {
296300 user: ' userId' ,
297301 },
@@ -308,22 +312,23 @@ To have Log resource appear in AdminJS panel, we have to define it first. 
308312
309313``` javascript
310314import { createLoggerResource } from ' @adminjs/logger' ;
311- import Log from ' ./logs.entity' ;
315+
316+ import Log from ' ./logs.entity.js' ;
312317
313318const config = {
314- resource: Log,
315- featureOptions: {
316- propertiesMapping: {
317- recordTitle: ' title' // field to store logged record's title
318- },
319- userIdAttribute: ' id' , // primary key currently logged user
320- resourceOptions: {
321- navigation: {
322- name: ' SectionName' ,
323- icon: ' iconName'
324- }
325- }
319+ resource: Log,
320+ featureOptions: {
321+ propertiesMapping: {
322+ recordTitle: ' title' // field to store logged record's title
323+ ,
324+ userIdAttribute: ' id' , // primary key currently logged user
325+ resourceOptions: {
326+ navigation: {
327+ name: ' SectionName' ,
328+ icon: ' iconName'
329+ }
326330 }
331+ }
327332}
328333
329334export default createLoggerResource (config)
0 commit comments