From f10719c212e488b93cad3e3df9eb0f5de582fe3d Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 19 Dec 2021 21:33:11 +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 2cc77e6..0abd336 100644 --- a/auth/group.go +++ b/auth/group.go @@ -40,3 +40,9 @@ var BeforeGroupUpdate func(*Group) error = func(g *Group) error { return nil } func (grp *Group) BeforeUpdate(tx *gorm.DB) (err error) { return BeforeGroupUpdate(grp) } + +var BeforeGroupDelete func(*Group) error = func(g *Group) error { return nil } + +func (grp *Group) BeforeDelete(tx *gorm.DB) (err error) { + return BeforeGroupDelete(grp) +}