FactuGES_ERP/modules/customers/src/web/shared/api/get-customer-by-id.api.ts

10 lines
351 B
TypeScript
Raw Normal View History

2026-03-10 17:10:11 +00:00
import type { IDataSource } from "@erp/core/client";
2026-03-23 11:13:33 +00:00
import type { Customer } from "../entities";
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");
const response = dataSource.getOne<Customer>("customers", id, { signal });
return response;
}