task-c.1
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
import {
|
||||
getCustomerActivity,
|
||||
getCustomerDetail,
|
||||
getCustomerOwnerHistory,
|
||||
softDeleteCustomer,
|
||||
updateCustomer
|
||||
} from '@/features/crm/customers/server/service';
|
||||
@@ -37,9 +38,10 @@ export async function GET(_request: NextRequest, { params }: Params) {
|
||||
userId: session.user.id,
|
||||
membership
|
||||
});
|
||||
const [customer, activity] = await Promise.all([
|
||||
const [customer, activity, ownerHistory] = await Promise.all([
|
||||
getCustomerDetail(id, organization.id, accessContext),
|
||||
getCustomerActivity(id, organization.id)
|
||||
getCustomerActivity(id, organization.id),
|
||||
getCustomerOwnerHistory(id, organization.id, accessContext)
|
||||
]);
|
||||
|
||||
return NextResponse.json({
|
||||
@@ -47,7 +49,8 @@ export async function GET(_request: NextRequest, { params }: Params) {
|
||||
time: new Date().toISOString(),
|
||||
message: 'Customer loaded successfully',
|
||||
customer,
|
||||
activity
|
||||
activity,
|
||||
ownerHistory
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof AuthError) {
|
||||
|
||||
Reference in New Issue
Block a user