🐛 Fixes server requests
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user