fix import channel id

Signed-off-by: Ben Hall <ben@benh.codes>
This commit is contained in:
Ben Hall 2025-02-09 13:57:08 +00:00
parent b830bd0833
commit d9986c754a

View File

@ -620,10 +620,13 @@ func ImportHandler(ctx *gin.Context) {
} }
} }
if err := dbclient.Client.Tickets.SetChannelId(ctx, guildId, newTicketId, *ticket.ChannelId); err != nil { if ticket.ChannelId != nil {
ctx.JSON(500, utils.ErrorJson(err)) if err := dbclient.Client.Tickets.SetChannelId(ctx, guildId, newTicketId, *ticket.ChannelId); err != nil {
return ctx.JSON(500, utils.ErrorJson(err))
return
}
} }
if err := dbclient.Client.Tickets.SetHasTranscript(ctx, guildId, newTicketId, ticket.HasTranscript); err != nil { if err := dbclient.Client.Tickets.SetHasTranscript(ctx, guildId, newTicketId, ticket.HasTranscript); err != nil {
ctx.JSON(500, utils.ErrorJson(err)) ctx.JSON(500, utils.ErrorJson(err))
return return