change route admin service
This commit is contained in:
@@ -21,18 +21,20 @@ export const deleteAdmin = async (id: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const createAdmin = async (params: CreateAdminType) => {
|
export const createAdmin = async (params: CreateAdminType) => {
|
||||||
const { data } = await axios.post("/admin", params);
|
const { data } = await axios.post("/admin/admins", params);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateAdmin = async (id: string, params: CreateAdminType) => {
|
export const updateAdmin = async (id: string, params: CreateAdminType) => {
|
||||||
const { data } = await axios.patch(`/admin/${id}`, params);
|
const { data } = await axios.patch(`/admin/admins/${id}`, params);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAdminById = async (
|
export const getAdminById = async (
|
||||||
adminId: string
|
adminId: string
|
||||||
): Promise<GetAdminByIdResponse> => {
|
): Promise<GetAdminByIdResponse> => {
|
||||||
const { data } = await axios.get<GetAdminByIdResponse>(`/admin/${adminId}`);
|
const { data } = await axios.get<GetAdminByIdResponse>(
|
||||||
|
`/admin/admins/${adminId}`
|
||||||
|
);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user