create project

This commit is contained in:
2026-04-28 13:58:34 +07:00
parent 68d05da584
commit 6d0ad4a270
16 changed files with 439 additions and 105 deletions
+5 -1
View File
@@ -17,6 +17,7 @@ import "yet-another-react-lightbox/plugins/captions.css";
import { createHistorianCV } from "@/service/historianService";
import { toast } from "sonner";
import Swal from "sweetalert2";
import { PresignedUrlResponse } from "@/interface/media";
type PendingFile = {
id: string;
@@ -26,7 +27,7 @@ type PendingFile = {
size: number;
type: "image" | "document";
extension: string;
presigned?: any;
presigned?: PresignedUrlResponse;
};
export default function RoleUpgrade() {
@@ -131,6 +132,9 @@ export default function RoleUpgrade() {
setIsSubmitting(true);
const uploadPromises = pendingFiles.map(async (item) => {
if (!item.presigned) {
throw new Error(`Không thể lấy URL tải lên cho tệp: ${item.name}`);
}
await uploadFileToS3(item.file, item.presigned);
const confirmRes = await confirmUpload(item.presigned.token_id);
return confirmRes?.data?.id || confirmRes?.id;