Fix verifyTeams if no teams exist

This commit is contained in:
rxdn 2022-06-15 14:44:25 +01:00
parent a81f5dccca
commit 64b162e7e6

View File

@ -406,6 +406,12 @@ func (p *panelBody) verifyFormId(guildId uint64) (bool, error) {
}
func (p *panelBody) verifyTeams(guildId uint64) (bool, error) {
// Query does not work nicely if there are no teams created in the guild, but if the user submits no teams,
// then the input is guaranteed to be valid.
if len(p.Teams) == 0 {
return true, nil
}
return dbclient.Client.SupportTeam.AllTeamsExistForGuild(guildId, p.Teams)
}