FactuGES_ERP/modules/customers/src/web/shared/api/get-customer-by-id.api.ts
2026-03-31 10:21:48 +02:00

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