14 lines
498 B
TypeScript
14 lines
498 B
TypeScript
import {Customer} from "@/services/customers/entities/customer";
|
|
import {CreateCustomerDto} from "@/services/customers/dtos/createCustomer.dto";
|
|
import {callApi} from "@/lib/api/callApi";
|
|
|
|
export class CustomerRepository {
|
|
static async getAll(): Promise<Customer[]> {
|
|
return await callApi<Customer[]>("/customers", "GET");
|
|
}
|
|
|
|
static async create(payload: CreateCustomerDto): Promise<void> {
|
|
await callApi<void, CreateCustomerDto>("/customers", "POST", payload);
|
|
}
|
|
}
|