feat(crm): align nested conversation payloads
This commit is contained in:
@@ -108,6 +108,14 @@ func serializeConversationList(ctx context.Context, db *gorm.DB, conversations [
|
||||
}}
|
||||
}
|
||||
|
||||
func serializeConversationPayloads(ctx context.Context, db *gorm.DB, conversations []model.Conversation) []chatwootConversationPayload {
|
||||
payload := make([]chatwootConversationPayload, 0, len(conversations))
|
||||
for i := range conversations {
|
||||
payload = append(payload, serializeConversation(ctx, db, &conversations[i]))
|
||||
}
|
||||
return payload
|
||||
}
|
||||
|
||||
func serializeConversation(ctx context.Context, db *gorm.DB, conversation *model.Conversation) chatwootConversationPayload {
|
||||
var lastMessage *model.Message
|
||||
if db != nil {
|
||||
|
||||
Reference in New Issue
Block a user