10 lines
391 B
TypeScript
10 lines
391 B
TypeScript
import type { IDataSource } from "@erp/core/client";
|
|
|
|
import type { GetCustomerByIdResponseDTO } from "../../../common";
|
|
|
|
export async function getCustomerById(dataSource: IDataSource, signal: AbortSignal, id?: string) {
|
|
if (!id) throw new Error("customerId is required");
|
|
const response = dataSource.getOne<GetCustomerByIdResponseDTO>("customers", id, { signal });
|
|
return response;
|
|
}
|