Closed cadecannon closed 1 year ago
Hi sorry for the mismatch documentation try something like this below and write here if works properly
import { auditCustom } from '@ioc:Adonis/Addons/AuditMixin'
on my project its working
await auditCustom({
event: CustomAuditEvents.manifestEvent,
data: { custom: 'data' },
auditable: 'VehicleType',
auditable_id: vehicleType.id,
ctx: ctx,
})
Does not appear to work for me. I'm now getting the following error:
(0 , AuditMixin_1.auditCustom) is not a function
I am running 5.9.0 of adonis/core and 3.1.1 of adonis5-audit.
When I import this:
import { Audit, auditCustom } from '@ioc:Adonis/Addons/AuditMixin'
Audit exists but auditCustom does not.
Your tsconfig.json
have the following typo notations inside import and include keys?
{
"extends": "./node_modules/adonis-preset-ts/tsconfig",
"exclude": [
"node_modules",
"build"
],
"compilerOptions": {
"strict": false,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"outDir": "build",
"alwaysStrict": true,
"rootDir": "./",
"target": "ESNext",
"sourceMap": true,
"paths": {
"App/*": [
"./app/*"
],
"Config/*": [
"./config/*"
],
"Contracts/*": [
"./contracts/*"
],
"Services/*": [
"./Services/*"
],
"Database/*": [
"./database/*"
]
},
"types": [
"@adonisjs/core",
"@adonisjs/repl",
"@adonisjs/auth",
"@adonisjs/lucid",
"@adonisjs/shield",
"@adonisjs/bouncer",
"adonis5-audit",
]
},
"include": [
"adonis5-audit"
]
}
If has it and stays in the problem, please create an empty repo, with the same problem for me to reproduce this behavior.
in my project its working nice with adonisjs/core@5.8.4 and adonis5-audit@3.1.1
It would be great if you create a repository to reproduce this problem and make sure it's not some configuration in your environment, so if it's a missing configuration, let us know so we can improve the documentation and add the missing steps. @cadecannon
This issued will be closed due the lack of innactivity
After stepping through the install instructions, I was trying to log a custom event when a user OAuth's in via Ally. Unfortunately, I get an error that '../src/audit/createAudit' cannot be found. Looking in the code quickly, it looks like maybe this should be /src/Functional/createAudit, but that simple change did not result in a fix.