fixed typos and some linter suggestions

This commit is contained in:
Gani Georgiev
2024-01-23 20:56:14 +02:00
parent 80d65a198b
commit aabe820e35
17 changed files with 4635 additions and 4626 deletions

View File

@@ -122,6 +122,10 @@ func adminDeleteCommand(app core.App) *cobra.Command {
return errors.New("Invalid or missing email address.")
}
if !app.Dao().HasTable((&models.Admin{}).TableName()) {
return errors.New("Migration are not initialized yet. Please run 'migrate up' and try again.")
}
admin, err := app.Dao().FindAdminByEmail(args[0])
if err != nil {
color.Yellow("Admin %s is already deleted.", args[0])