task-ep.1.2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { z } from 'zod';
|
||||
import { listRecentActivitiesForContext } from '@/features/crm/activities/server/timeline-service';
|
||||
import { auditDelete, auditUpdate } from '@/features/foundation/audit-log/service';
|
||||
import {
|
||||
auditCrmSecurityEvent,
|
||||
@@ -38,10 +39,17 @@ export async function GET(_request: NextRequest, { params }: Params) {
|
||||
userId: session.user.id,
|
||||
membership
|
||||
});
|
||||
const [customer, activity, ownerHistory] = await Promise.all([
|
||||
const [customer, activity, ownerHistory, recentActivities] = await Promise.all([
|
||||
getCustomerDetail(id, organization.id, accessContext),
|
||||
getCustomerActivity(id, organization.id),
|
||||
getCustomerOwnerHistory(id, organization.id, accessContext)
|
||||
getCustomerOwnerHistory(id, organization.id, accessContext),
|
||||
listRecentActivitiesForContext({
|
||||
organizationId: organization.id,
|
||||
entityType: 'customer',
|
||||
entityId: id,
|
||||
context: accessContext,
|
||||
limit: 6
|
||||
})
|
||||
]);
|
||||
|
||||
return NextResponse.json({
|
||||
@@ -50,6 +58,7 @@ export async function GET(_request: NextRequest, { params }: Params) {
|
||||
message: 'Customer loaded successfully',
|
||||
customer,
|
||||
activity,
|
||||
recentActivities,
|
||||
ownerHistory
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user