Skip to content

Commit

Permalink
fix(voucher): check status param
Browse files Browse the repository at this point in the history
  • Loading branch information
mj committed Jul 6, 2024
1 parent 76d25bf commit edbb251
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/engine/command/voucher/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
)

func (v *Voucher) statusHandler(cmd command.Command, _ entity.AppID, _ string, args ...string) command.CommandResult {
if len(args) > 0 {
code := args[0]
return v.codeStatus(cmd, code)
if args == nil {
return v.vouchersStatus(cmd)
}

return v.vouchersStatus(cmd)
code := args[0]
return v.codeStatus(cmd, code)
}

func (v *Voucher) codeStatus(cmd command.Command, code string) command.CommandResult {
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/command/voucher/voucher.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (v *Voucher) GetCommand() command.Command {
Args: []command.Args{
{
Name: "code",
Desc: "Voucher code (8 characters))",
Desc: "Voucher code (8 characters)",
Optional: true,
},
},
Expand Down

0 comments on commit edbb251

Please sign in to comment.