Add customer management
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user