lookinlab/adonis-lucid-soft-deletes

TypeError: this.model.query.$getColumn is not a function

Closed this issue · 1 comments

TypeError: this.model.query.$getColumn is not a function at ModelQueryBuilder.onlyTrashed (adonis-lucid-soft-deletes/build/src/Bindings/ModelQueryBuilder.js:36:50)

The problem is in this two lines:

const deletedAtColumn = this.model.query.$getColumn('deletedAt')?.columnName

const deletedAtColumn = this.model.query.$getColumn('deletedAt')?.columnName

this.model is LucidModel and query is a function, as well as $getColumn is method of LucidModel but not ModelQueryBuilderContract. So it should be this.model.$getColumn().

Prerequisites

  • "@adonisjs/lucid": "18.0.0"
  • "adonis-lucid-soft-deletes": "1.4.2"

Hi @KageNoNeko! You right, thanks!
Fixed in v1.4.3