invoice + plan
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import * as api from "../service/CustomerService";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
export const useGetCustomers = () => {
|
||||
return useQuery({
|
||||
queryKey: ["invoices"],
|
||||
queryFn: () => api.getCustomers(),
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import axios from "../../../config/axios";
|
||||
|
||||
export const getCustomers = async () => {
|
||||
const { data } = await axios.get(`/users/customers`);
|
||||
return data;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
export type CustomerItemType = {
|
||||
birthDate: string;
|
||||
createdAt: string;
|
||||
email: string | null;
|
||||
firstName: string;
|
||||
id: string;
|
||||
invoices: unknown[];
|
||||
lastName: string;
|
||||
nationalCode: string;
|
||||
phone: string;
|
||||
role: {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
// Add other properties of role if needed
|
||||
};
|
||||
subscriptions: unknown[];
|
||||
tickets: unknown[];
|
||||
updatedAt: string;
|
||||
userName: string | null;
|
||||
};
|
||||
Reference in New Issue
Block a user