TP-0000 | adding channel id in team response (#82)

This commit is contained in:
Shubham Kirve
2023-05-18 23:32:51 +05:30
committed by GitHub Enterprise
parent 957f2fa32a
commit 7bb1e1dcdc
2 changed files with 2 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ type TeamResponse struct {
Participants []UserResponse `json:"participants,omitempty"`
UpdatedAt time.Time `json:"lastUpdatedAt,omitempty"`
WebhookSlackChannelName string `json:"webhookSlackChannelName"`
WebhookSlackChannelId string `json:"webhookSlackChannelId"`
}
func ConvertToTeamResponse(teamEntity team.TeamEntity) TeamResponse {

View File

@@ -68,6 +68,7 @@ func (t *teamService) GetTeams(c *gin.Context) {
}
channel, err := t.client.GetConversationInfo(team.WebhookSlackChannel)
teamResponse := service.ConvertToTeamResponse(*team)
teamResponse.WebhookSlackChannelId = team.WebhookSlackChannel
if err != nil {
t.logger.Error("error in getting channel info", zap.String("channelId", team.WebhookSlackChannel), zap.Error(err))
teamResponse.WebhookSlackChannelName = "not found"