From d9986c754a5e57b44d7de71e4a3f545d87d50ba8 Mon Sep 17 00:00:00 2001 From: Ben Hall Date: Sun, 9 Feb 2025 13:57:08 +0000 Subject: [PATCH] fix import channel id Signed-off-by: Ben Hall --- app/http/endpoints/api/export/import.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/http/endpoints/api/export/import.go b/app/http/endpoints/api/export/import.go index 0d07651..3c951fa 100644 --- a/app/http/endpoints/api/export/import.go +++ b/app/http/endpoints/api/export/import.go @@ -620,10 +620,13 @@ func ImportHandler(ctx *gin.Context) { } } - if err := dbclient.Client.Tickets.SetChannelId(ctx, guildId, newTicketId, *ticket.ChannelId); err != nil { - ctx.JSON(500, utils.ErrorJson(err)) - return + if ticket.ChannelId != nil { + if err := dbclient.Client.Tickets.SetChannelId(ctx, guildId, newTicketId, *ticket.ChannelId); err != nil { + ctx.JSON(500, utils.ErrorJson(err)) + return + } } + if err := dbclient.Client.Tickets.SetHasTranscript(ctx, guildId, newTicketId, ticket.HasTranscript); err != nil { ctx.JSON(500, utils.ErrorJson(err)) return