remove contact company/country/location across db and ui

This commit is contained in:
Ruslan Bakiev
2026-02-23 14:52:26 +07:00
parent f6b738352b
commit 60b9bb9fd1
15 changed files with 42 additions and 135 deletions

View File

@@ -184,7 +184,7 @@ async function buildCrmSnapshot(input: SnapshotOptions) {
orderBy: { updatedAt: "desc" },
take: 20,
include: {
contact: { select: { name: true, company: true } },
contact: { select: { name: true } },
steps: { select: { id: true, title: true, status: true, dueAt: true, order: true, completedAt: true }, orderBy: [{ order: "asc" }, { createdAt: "asc" }] },
},
}),
@@ -247,15 +247,11 @@ async function buildCrmSnapshot(input: SnapshotOptions) {
updatedAt: iso(d.updatedAt),
contact: {
name: d.contact.name,
company: d.contact.company,
},
})),
contacts: contacts.map((c) => ({
id: c.id,
name: c.name,
company: c.company,
country: c.country,
location: c.location,
email: c.email,
phone: c.phone,
avatarUrl: c.avatarUrl,
@@ -549,7 +545,6 @@ export async function runLangGraphCrmAgentFor(input: {
? {
OR: [
{ name: { contains: q } },
{ company: { contains: q } },
{ email: { contains: q } },
{ phone: { contains: q } },
],
@@ -593,9 +588,6 @@ export async function runLangGraphCrmAgentFor(input: {
items: items.map((c) => ({
id: c.id,
name: c.name,
company: c.company,
country: c.country,
location: c.location,
email: c.email,
phone: c.phone,
summary: c.note?.content ?? null,
@@ -711,9 +703,6 @@ export async function runLangGraphCrmAgentFor(input: {
contact: {
id: contact.id,
name: contact.name,
company: contact.company,
country: contact.country,
location: contact.location,
email: contact.email,
phone: contact.phone,
updatedAt: contact.updatedAt.toISOString(),
@@ -790,7 +779,7 @@ export async function runLangGraphCrmAgentFor(input: {
orderBy: { startsAt: "asc" },
skip: offset,
take: limit,
include: { contact: { select: { id: true, name: true, company: true } } },
include: { contact: { select: { id: true, name: true } } },
}),
]);
@@ -817,7 +806,6 @@ export async function runLangGraphCrmAgentFor(input: {
? {
id: e.contact.id,
name: e.contact.name,
company: e.contact.company,
}
: null,
})),