mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Add more unit tests
This commit is contained in:
@ -41,15 +41,15 @@ func (m *Model) Save() error {
|
||||
return result.Error
|
||||
}
|
||||
|
||||
// Delete will mark row as deleted
|
||||
func (m *Model) Delete() bool {
|
||||
// Delete will mark a row as deleted
|
||||
func (m *Model) Delete() error {
|
||||
if m.ID == 0 {
|
||||
// Can't delete a new object
|
||||
return false
|
||||
return eris.New("Unable to delete a new object")
|
||||
}
|
||||
db := database.GetDB()
|
||||
result := db.Delete(m)
|
||||
return result.Error == nil
|
||||
return result.Error
|
||||
}
|
||||
|
||||
// Check will ensure the ca bundle path exists if it's set
|
||||
|
Reference in New Issue
Block a user