import client by excel

This commit is contained in:
2026-06-18 23:01:25 +03:30
parent 13c6de66b3
commit 4d27448450
7 changed files with 252 additions and 5 deletions
@@ -2,6 +2,7 @@ import axios from "@/config/axios";
import type {
GetCustomersResponse,
GetUsersParams,
ImportUsersResponse,
} from "@/pages/customers/types/Types";
export const getUsers = async (params?: GetUsersParams) => {
@@ -10,3 +11,20 @@ export const getUsers = async (params?: GetUsersParams) => {
});
return data;
};
export const importUsersFromExcel = async (file: File) => {
const formData = new FormData();
formData.append("file", file);
const { data } = await axios.post<ImportUsersResponse>(
`/admin/users/import`,
formData,
{
headers: {
"Content-Type": "multipart/form-data",
},
},
);
return data.data;
};