vikunja-api/models/user_delete.go
2018-10-27 09:33:28 +00:00

18 lines
286 B
Go

package models
// DeleteUserByID deletes a user by its ID
func DeleteUserByID(id int64, doer *User) error {
// Check if the id is 0
if id == 0 {
return ErrIDCannotBeZero{}
}
// Delete the user
_, err := x.Id(id).Delete(&User{})
if err != nil {
return err
}
return err
}