🐛 Fixes server requests
All checks were successful
Gitea Build Action / build-go (push) Successful in 27s
Gitea Build Action / build-nuxt (push) Successful in 10m40s

This commit is contained in:
Daniel Svitan
2025-06-07 15:49:34 +02:00
parent cf35326bf2
commit 53722bdf18
4 changed files with 25 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ type ChangeLockReq struct {
}
type ChangeAlertReq struct {
Alert bool `json:"alert"`
Alert bool `json:"alerts"`
For int `json:"for"`
}
@@ -135,14 +135,16 @@ func main() {
Usage: "change lock status",
Commands: []*cli.Command{
{
Name: "yes",
Usage: "lock the door",
Action: createManageLock(true),
Name: "yes",
Usage: "lock the door",
Aliases: []string{"y", "on", "1", "do"},
Action: createManageLock(true),
},
{
Name: "no",
Usage: "unlock the door",
Action: createManageLock(false),
Name: "no",
Usage: "unlock the door",
Aliases: []string{"n", "off", "0", "undo"},
Action: createManageLock(false),
},
},
Action: getLocked,
@@ -152,13 +154,15 @@ func main() {
Usage: "change alert status",
Commands: []*cli.Command{
{
Name: "yes",
Usage: "resume alerts",
Action: createManageAlert(true),
Name: "yes",
Usage: "resume alerts",
Aliases: []string{"y", "on", "1", "do"},
Action: createManageAlert(true),
},
{
Name: "no",
Usage: "pause alerts",
Name: "no",
Usage: "pause alerts",
Aliases: []string{"n", "off", "0", "undo"},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "for",
@@ -322,7 +326,7 @@ func createManageAlert(alert bool) func(context.Context, *cli.Command) error {
action = "paused"
}
fmt.Printf("alerts were %sd%s\n", action, rest)
fmt.Printf("alerts were %s%s\n", action, rest)
return nil
}
}