pig update
This commit is contained in:
@@ -11,7 +11,6 @@ export const apiGetListUser = async (payload: getUserDto) => {
|
||||
|
||||
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) => {
|
||||
@@ -32,3 +31,14 @@ export const apiGetUserMedia = async (id: string) => {
|
||||
const response = await api.get(API.Admin.GET_USER_MEDIA(id));
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiUpdateApplicationStatus = async (id: string, payload: any) => {
|
||||
const response = await api.patch(API.Admin.UPDATE_APPLICATION_STATUS(id), payload);
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiGetUserById = async (userId: string) => {
|
||||
// Thay đổi URL sao cho khớp với route Backend của bạn
|
||||
const response = await api.get(API.Admin.GET_USER_BY_ID(userId));
|
||||
return response?.data;
|
||||
};
|
||||
13
src/service/historianService.ts
Normal file
13
src/service/historianService.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import api from "@/config/config";
|
||||
import { API } from "../../api";
|
||||
|
||||
export const createHistorianCV = async (payload: any) => {
|
||||
const response = await api.post(API.Historian.CREATE_CV, payload);
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiGetUserApplications = async (payload :any) => {
|
||||
const response = await api.get(API.Historian.APPLICATION, { params: payload });
|
||||
// console.log("API Response:", response.data);
|
||||
return response?.data;
|
||||
};
|
||||
@@ -88,3 +88,23 @@ export const uploadMedia = async (file: File) => {
|
||||
// console.log("Media sau khi upload:", media);
|
||||
return media;
|
||||
};
|
||||
|
||||
export const getPresignedUrl = async (file: File) => {
|
||||
const { data: presigned } = await api.get<PreSignedResponse>(
|
||||
"/media/presigned",
|
||||
{
|
||||
params: {
|
||||
fileName: file.name,
|
||||
contentType: file.type,
|
||||
size: file.size,
|
||||
},
|
||||
},
|
||||
);
|
||||
return presigned;
|
||||
};
|
||||
|
||||
export const getMediaById = async (mediaId: number | string) => {
|
||||
const response = await api.get(API.Media.GET_MEDIA_BY_ID(mediaId));
|
||||
return response?.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,11 @@ export const apiGetCurrentUserMedia = async () => {
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiGetCurrentUserApplications = async () => {
|
||||
const response = await api.get(API.User.APPLICATION);
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
export const apiUpdateUser = async (id: number | string, payload: Profile) => {
|
||||
const response = await api.put(API.User.Update(id), payload);
|
||||
return response?.data;
|
||||
|
||||
Reference in New Issue
Block a user