radmen / adonis-lucid-soft-deletes

Experimental implementation of soft-deletes for Adonis Lucid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delete method update the all dirty fields

farshadfahimi opened this issue · comments

I have query and select the one row use merge for change some of the fields

after that in some condition need to delete the first one and after that clear a clone from the first one but determined when call the delete method it just update prev model data and change my data

for more info you can check the sample code below

let order = Order.find(10)
order.merge({
amount: 100000
})

if (order.amount > 100) {
 await order.delete() //this line update all of the prev order
 order = new Order()
 order.fill({ amount: 100 })
}

when I'm deleting the order just need the deleted_at field change and forget all the other changes