Skip to content

Commit

Permalink
fix(api-gql): disallow to create/update commands with empty aliase
Browse files Browse the repository at this point in the history
fixes #754
  • Loading branch information
Satont committed Jun 27, 2024
1 parent f3b9e56 commit ed8d66c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
68 changes: 43 additions & 25 deletions apps/api-gql/internal/gql/resolvers/commands.resolver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apps/api-gql/schema/commands.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type PublicCommandPermission {
input CommandsCreateOpts {
name: String! @validate(constraint: "max=50")
description: String! @validate(constraint: "max=500")
aliases: [String!]! @validate(constraint: "dive,max=50")
aliases: [String!]! @validate(constraint: "dive,max=50,min=1")
responses: [CreateOrUpdateCommandResponseInput!]!
cooldown: Int! @validate(constraint: "max=90000")
cooldownType: String!
Expand All @@ -84,7 +84,7 @@ input CommandsCreateOpts {
input CommandsUpdateOpts {
name: String @validate(constraint: "max=50")
description: String @validate(constraint: "max=500")
aliases: [String!] @validate(constraint: "dive,max=50")
aliases: [String!] @validate(constraint: "dive,max=50,min=1")
responses: [CreateOrUpdateCommandResponseInput!]
cooldown: Int
cooldownType: String
Expand Down

0 comments on commit ed8d66c

Please sign in to comment.