Skip to content

audit is not a function #1

Description

@go4cas

I have followed the instructions, as per the README, but when trying to add a record, I get the following error: "Position.audit is not a function".

Here's an extract of my model and controller:

Models\Positions.js:

class Position extends Model {
  boot () {
    super.boot()
    this.addTrait('@provider:Auditable')
  }
}

Controllers\Http\PositionController.js:

class PositionController {
  async store ({ request, response }) {
    const data = request.all()
    const position = await Position.audit().create(data)
    return position
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions