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

10 lines
391 B
TypeScript
Raw Normal View History

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;
}