feat(conversation): expose current team in responses
This commit is contained in:
@@ -24,6 +24,7 @@ func BuildConversation(item *models.Conversation) response.ConversationResponse
|
||||
ServiceMode: item.ServiceMode,
|
||||
Priority: item.Priority,
|
||||
CurrentAssigneeID: item.CurrentAssigneeID,
|
||||
CurrentTeamID: item.CurrentTeamID,
|
||||
LastMessageID: item.LastMessageID,
|
||||
LastMessageAt: utils.FormatTime(item.LastMessageAt),
|
||||
LastActiveAt: utils.FormatTime(item.LastActiveAt),
|
||||
@@ -51,6 +52,11 @@ func BuildConversation(item *models.Conversation) response.ConversationResponse
|
||||
}
|
||||
}
|
||||
}
|
||||
if item.CurrentTeamID > 0 {
|
||||
if team := services.AgentTeamService.Get(item.CurrentTeamID); team != nil {
|
||||
ret.CurrentTeamName = team.Name
|
||||
}
|
||||
}
|
||||
if item.ClosedBy > 0 {
|
||||
if user := services.UserService.Get(item.ClosedBy); user != nil {
|
||||
ret.ClosedByName = user.Nickname
|
||||
|
||||
Reference in New Issue
Block a user