2026-03-10 17:10:11 +00:00
|
|
|
import type { IDataSource } from "@erp/core/client";
|
|
|
|
|
|
2026-03-31 08:21:48 +00:00
|
|
|
import type { GetCustomerByIdResponseDTO } from "../../../common";
|
2026-03-10 17:10:11 +00:00
|
|
|
|
|
|
|
|
export async function getCustomerById(dataSource: IDataSource, signal: AbortSignal, id?: string) {
|
|
|
|
|
if (!id) throw new Error("customerId is required");
|
2026-03-31 08:21:48 +00:00
|
|
|
const response = dataSource.getOne<GetCustomerByIdResponseDTO>("customers", id, { signal });
|
2026-03-10 17:10:11 +00:00
|
|
|
return response;
|
|
|
|
|
}
|