-
Notifications
You must be signed in to change notification settings - Fork 642
Closed
Labels
Description
Given a model
export default class User extends Model {
static tableName = 'users';
async $beforeValidate() {
console.log('beforeValidate', this, arguments);
}
async $afterValidate() {
console.log('afterValidate', this, arguments);
}
async $beforeUpdate() {
console.log('beforeUpdate', this, arguments);
}
async $afterUpdate() {
console.log('afterUpdate', this, arguments);
}
}
// then
const user = await User.query().insert({ a: 1 });
await user.$query().patch({ a: 2 });
Seems like I never have the old value { a: 1 } in thisor json. Is it possible?