added explicit errors when trying to truncate view collections or deleting view records
This commit is contained in:
@@ -378,7 +378,13 @@ func (app *BaseApp) registerRecordHooks() {
|
||||
e.Context,
|
||||
e.App,
|
||||
InterceptorActionDelete,
|
||||
e.Next,
|
||||
func() error {
|
||||
if e.Record.Collection().IsView() {
|
||||
return errors.New("view records cannot be deleted")
|
||||
}
|
||||
|
||||
return e.Next()
|
||||
},
|
||||
)
|
||||
},
|
||||
Priority: -99,
|
||||
|
||||
Reference in New Issue
Block a user