This commit is contained in:
phaichayon
2026-06-22 15:49:31 +07:00
parent 1b901efc51
commit 3f28fde39f
36 changed files with 2602 additions and 56 deletions

View File

@@ -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) {