This commit is contained in:
@ -330,15 +330,17 @@ export async function getInboxWorkspace({ scope, conversationId, filter = "all"
|
||||
return {
|
||||
id: conversation.id,
|
||||
tenantId: conversation.tenantId,
|
||||
name: conversation.contact.fullName,
|
||||
phone: conversation.contact.phoneNumber,
|
||||
name: conversation.contact?.fullName ?? "Unknown Contact",
|
||||
phone: conversation.contact?.phoneNumber ?? "-",
|
||||
snippet: latestMessage?.contentText ?? conversation.subject ?? "No content",
|
||||
time: formatRelativeDate(conversation.lastMessageAt),
|
||||
status: mapConversationStatus(conversation.status),
|
||||
assignee: conversation.assignedUser?.fullName ?? "Unassigned",
|
||||
assigneeId: conversation.assignedUser?.id ?? null,
|
||||
channel: conversation.channel.channelName,
|
||||
tags: conversation.conversationTags.map((item) => item.tag.name),
|
||||
channel: conversation.channel?.channelName ?? "Unknown Channel",
|
||||
tags: conversation.conversationTags
|
||||
.map((item) => item.tag?.name)
|
||||
.filter((tag): tag is string => Boolean(tag)),
|
||||
priority: mapConversationPriority(conversation.priority),
|
||||
contactId: conversation.contactId
|
||||
} satisfies ConversationSummary;
|
||||
@ -394,17 +396,19 @@ export async function getInboxWorkspace({ scope, conversationId, filter = "all"
|
||||
? {
|
||||
id: fullConversation.id,
|
||||
tenantId: fullConversation.tenantId,
|
||||
name: fullConversation.contact.fullName,
|
||||
phone: fullConversation.contact.phoneNumber,
|
||||
name: fullConversation.contact?.fullName ?? "Unknown Contact",
|
||||
phone: fullConversation.contact?.phoneNumber ?? "-",
|
||||
snippet: fullConversation.subject ?? fullConversation.messages[0]?.contentText ?? "No content",
|
||||
time: formatRelativeDate(fullConversation.lastMessageAt),
|
||||
status: mapConversationStatus(fullConversation.status),
|
||||
assignee: fullConversation.assignedUser?.fullName ?? "Unassigned",
|
||||
assigneeId: fullConversation.assignedUser?.id ?? null,
|
||||
channel: fullConversation.channel.channelName,
|
||||
tags: fullConversation.conversationTags.map((item) => item.tag.name),
|
||||
channel: fullConversation.channel?.channelName ?? "Unknown Channel",
|
||||
tags: fullConversation.conversationTags
|
||||
.map((item) => item.tag?.name)
|
||||
.filter((tag): tag is string => Boolean(tag)),
|
||||
priority: mapConversationPriority(fullConversation.priority),
|
||||
contactId: fullConversation.contact.id,
|
||||
contactId: fullConversation.contact?.id ?? fullConversation.contactId,
|
||||
tagJson: JSON.stringify(fullConversation.conversationTags.map((item) => item.tag.name)),
|
||||
messages: fullConversation.messages
|
||||
.slice()
|
||||
|
||||
Reference in New Issue
Block a user