This commit is contained in:
Archer
2023-11-10 11:14:08 +08:00
committed by GitHub
parent 0a0fe31d3c
commit d91551e6be
17 changed files with 257 additions and 26 deletions

View File

@@ -51,13 +51,13 @@ class UploadModel {
}
resolve({
...req.body,
files:
// @ts-ignore
req.files?.map((file) => ({
...file,
originalname: decodeURIComponent(file.originalname)
})) || [],
bucketName: req.body.bucketName,
metadata: (() => {
if (!req.body?.metadata) return {};
try {
@@ -80,6 +80,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
try {
await connectToDatabase();
const { userId, teamId, tmbId } = await authCert({ req, authToken: true });
console.log(req.body);
const { files, bucketName, metadata } = await upload.doUpload(req, res);