sort
This commit is contained in:
@@ -3,8 +3,31 @@ import { API } from "../../api";
|
||||
import { getUserDto } from "@/interface/admin";
|
||||
|
||||
export const apiGetListUser = async (payload: getUserDto) => {
|
||||
const response = await api.get(API.Admin.GET_LIST_USERS, {
|
||||
const response = await api.get(API.Admin.GET_LIST_USERS, {
|
||||
params: payload,
|
||||
});
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiChangeRole = async (id: string, payload: any) => {
|
||||
const response = await api.patch(API.Admin.CHANGE_ROLE(id), payload);
|
||||
console.log("Response từ API sau khi đổi role:", response);
|
||||
return response?.data;
|
||||
};
|
||||
export const apiDeleteUser = async (id: string) => {
|
||||
const response = await api.delete(API.Admin.DELETE_USER(id));
|
||||
return response?.data;
|
||||
};
|
||||
export const apiRestoreUser = async (id: string) => {
|
||||
const response = await api.patch(API.Admin.RESTORE_USER(id));
|
||||
return response?.data;
|
||||
};
|
||||
export const apiGetAllRole = async () => {
|
||||
const response = await api.get(API.Admin.GET_ALL_ROLE);
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiGetUserMedia = async (id: string) => {
|
||||
const response = await api.get(API.Admin.GET_USER_MEDIA(id));
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
@@ -31,6 +31,11 @@ export const apiSignIn = async (payload: any) => {
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiResetPassword = async (payload: any) => {
|
||||
const response = await api.post(API.Auth.FORGOT_PASSWORD, payload);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetCurrentUser = async () => {
|
||||
const response = await api.get(API.User.CURRENT);
|
||||
return response?.data;
|
||||
|
||||
Reference in New Issue
Block a user