update application page, table.
This commit is contained in:
@@ -33,7 +33,7 @@ export const apiGetUserMedia = async (id: string) => {
|
||||
};
|
||||
|
||||
export const apiUpdateApplicationStatus = async (id: string, payload: any) => {
|
||||
const response = await api.patch(API.Admin.UPDATE_APPLICATION_STATUS(id), payload);
|
||||
const response = await api.put(API.Admin.UPDATE_APPLICATION_STATUS(id), payload);
|
||||
return response?.data;
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,5 @@ export const createHistorianCV = async (payload: any) => {
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -58,14 +58,14 @@ export const uploadFileToS3 = async (
|
||||
"Content-Type": file.type,
|
||||
},
|
||||
});
|
||||
// console.log("Response from S3 upload:", res);
|
||||
console.log("Response from S3 upload:", res);
|
||||
};
|
||||
|
||||
export const confirmUpload = async (token_id: string) => {
|
||||
const res = await api.post("/media/presigned/complete", {
|
||||
token_id,
|
||||
});
|
||||
|
||||
console.log("Response from confirm upload:", res);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
@@ -75,17 +75,17 @@ export const uploadMedia = async (file: File) => {
|
||||
{
|
||||
params: {
|
||||
fileName: file.name,
|
||||
contentType: file.type,
|
||||
content_type: file.type,
|
||||
size: file.size,
|
||||
},
|
||||
},
|
||||
);
|
||||
// console.log("Presigned URL:", presigned);
|
||||
console.log("Presigned URL:", presigned);
|
||||
|
||||
await uploadFileToS3(file, presigned);
|
||||
|
||||
const media = await confirmUpload(presigned.token_id);
|
||||
// console.log("Media sau khi upload:", media);
|
||||
console.log("Media sau khi upload:", media);
|
||||
return media;
|
||||
};
|
||||
|
||||
@@ -95,11 +95,12 @@ export const getPresignedUrl = async (file: File) => {
|
||||
{
|
||||
params: {
|
||||
fileName: file.name,
|
||||
contentType: file.type,
|
||||
content_type: file.type,
|
||||
size: file.size,
|
||||
},
|
||||
},
|
||||
);
|
||||
console.log("Presigned URL:", presigned);
|
||||
return presigned;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user