From dc896196c553976ffeaf91c823ba7a677c4bf775 Mon Sep 17 00:00:00 2001 From: yoneyan Date: Thu, 22 Jul 2021 23:33:55 +0900 Subject: [PATCH] [fix] #101 --- pkg/api/core/group/info/v0/info.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/api/core/group/info/v0/info.go b/pkg/api/core/group/info/v0/info.go index fc102430..60bc75ff 100644 --- a/pkg/api/core/group/info/v0/info.go +++ b/pkg/api/core/group/info/v0/info.go @@ -161,11 +161,16 @@ func Get(c *gin.Context) { } if !*tmpTicket.Request { + var groupIDTicket uint = 0 + if tmpTicket.GroupID != nil { + groupIDTicket = *tmpTicket.GroupID + } + // Ticket resultTicket = append(resultTicket, info.Ticket{ ID: tmpTicket.ID, CreatedAt: tmpTicket.CreatedAt, - GroupID: *tmpTicket.GroupID, + GroupID: groupIDTicket, UserID: *tmpTicket.UserID, Chat: resultChat, Solved: tmpTicket.Solved, @@ -205,15 +210,11 @@ func Get(c *gin.Context) { Data: tmpChat.Data, }) } - groupID = 0 - if authResult.User.GroupID != nil { - groupID = *authResult.User.GroupID - } resultTicket = append(resultTicket, info.Ticket{ ID: tmpTicket.ID, CreatedAt: tmpTicket.CreatedAt, - GroupID: groupID, + GroupID: 0, UserID: authResult.User.ID, Chat: resultChat, Solved: tmpTicket.Solved,