From 402d7e93b1dfc401d37be8f05c3da7bb8499d9a4 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 19 Dec 2021 21:32:09 +0800 Subject: [PATCH] add hook --- auth/group.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auth/group.go b/auth/group.go index 6636dab..2cc77e6 100644 --- a/auth/group.go +++ b/auth/group.go @@ -34,3 +34,9 @@ func (grp *Group) BeforeSave(tx *gorm.DB) (err error) { } return BeforeGroupSave(grp) } + +var BeforeGroupUpdate func(*Group) error = func(g *Group) error { return nil } + +func (grp *Group) BeforeUpdate(tx *gorm.DB) (err error) { + return BeforeGroupUpdate(grp) +}