update admin
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
AdminsType,
|
||||
CreateAdminType,
|
||||
RolesResponseType,
|
||||
AdminDetailResponseType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getAdmins = async (page: number) => {
|
||||
@@ -21,3 +22,15 @@ export const getRoles = async () => {
|
||||
const { data } = await axios.get<RolesResponseType>("/admin/roles");
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getAdminById = async (adminId: string) => {
|
||||
const { data } = await axios.get<AdminDetailResponseType>(
|
||||
`/admin/admins/${adminId}`,
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateAdmin = async (adminId: string, params: CreateAdminType) => {
|
||||
const { data } = await axios.patch(`/admin/admins/${adminId}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user