FactuGES_ERP/modules/customers/src/web/common/api/get-customer-by-ip.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";
import type { Customer } from "./api-types";
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;
}