07c61c1b1c
First push for beginning of project
26 lines
475 B
Go
26 lines
475 B
Go
package alert
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"git.tcp.direct/perp/shogo/internal/utils"
|
|
)
|
|
|
|
// Delete an alert
|
|
func Delete(id string) {
|
|
// Set results
|
|
results, err := utils.Client.DeleteAlert(context.Background(), id)
|
|
if err != nil {
|
|
fmt.Printf("%s: %s\n", utils.Red("Error"), err.Error())
|
|
return
|
|
}
|
|
|
|
// Print results
|
|
if results {
|
|
utils.Title.Println("Successfully deleted alert!")
|
|
} else {
|
|
fmt.Printf("%s: %s\n", utils.Red("Error"), "alert does not exist")
|
|
}
|
|
}
|