Closed hunkaf closed 3 years ago
Hi @hunkaf
This error not due to a package. If you will update model without a package, an error get also.
Somewhere in your code adding a field _zone
to user, which no in a db table
Need the checking all "a path" before delete a user instance. It's all a can i help
Hi @LookinGit, thanks for your quick answer.
I've tried to change one line in your code: https://github.com/lookinlab/adonis-lucid-soft-deletes/blob/develop/src/SoftDeletes/index.ts#L113
Original:
const softDelete = async (): Promise<void> => {
this.deletedAt = DateTime.local()
await this.save()
}
Modified:
const softDelete = async (): Promise<void> => {
this.deletedAt = DateTime.local().toISO({ includeOffset: false })
await this.save()
}
Now it is working. Do you accept a PR for this change?
Thanks @hunkaf for this test. This is my bug
Try add to your User
model next code
@column.dateTime()
public deletedAt: DateTime | null
And write a result here. Fixed this code an error or no.
If add this, then working great :)
Maybe you could modify your code, when adding the column here: https://github.com/lookinlab/adonis-lucid-soft-deletes/blob/develop/src/SoftDeletes/index.ts#L29
The lucid datetime decorator adds a lot option here: https://github.com/adonisjs/lucid/blob/develop/src/Orm/Decorators/datetime.ts
@hunkaf thanks yep, i will fix this later in free time
Hello, thanks for this great package. I've implemented according to your readme, and unfortunately got the below error, when trying to delete a user.
Could you please help me out with this? Thanks in advance!
My
package.json
:AdonisJS app is running in docker, if that matters.