fix ticket panel import
Signed-off-by: Ben Hall <ben@benh.codes>
This commit is contained in:
parent
5048358263
commit
b830bd0833
@ -595,8 +595,12 @@ func ImportHandler(ctx *gin.Context) {
|
|||||||
// Import tickets
|
// Import tickets
|
||||||
for _, ticket := range data.Tickets {
|
for _, ticket := range data.Tickets {
|
||||||
if _, ok := ticketIdMap[ticket.Id]; !ok {
|
if _, ok := ticketIdMap[ticket.Id]; !ok {
|
||||||
newPanelId := panelIdMap[*ticket.PanelId]
|
var panelId *int
|
||||||
newTicketId, err := dbclient.Client.Tickets.Create(ctx, guildId, ticket.UserId, ticket.IsThread, &newPanelId)
|
if ticket.PanelId != nil {
|
||||||
|
a := panelIdMap[*ticket.PanelId]
|
||||||
|
panelId = &a
|
||||||
|
}
|
||||||
|
newTicketId, err := dbclient.Client.Tickets.Create(ctx, guildId, ticket.UserId, ticket.IsThread, panelId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.JSON(500, utils.ErrorJson(err))
|
ctx.JSON(500, utils.ErrorJson(err))
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user