refactor: update TargetDel
This commit is contained in:
parent
143880cd46
commit
1bdfa3e032
|
@ -60,6 +60,7 @@ _test
|
|||
.vscode
|
||||
.issue
|
||||
.cursor
|
||||
.claude
|
||||
.DS_Store
|
||||
.cache-loader
|
||||
.payload
|
||||
|
|
|
@ -124,7 +124,7 @@ func TargetStatistics(ctx *ctx.Context) (*Statistics, error) {
|
|||
|
||||
func TargetDel(ctx *ctx.Context, idents []string, deleteHook TargetDeleteHookFunc) error {
|
||||
if len(idents) == 0 {
|
||||
panic("idents empty")
|
||||
return errors.New("idents cannot be empty")
|
||||
}
|
||||
|
||||
return DB(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
|
|
Loading…
Reference in New Issue