fix name from originBucekerName to originBucketName (#1114)

This commit is contained in:
Yao Yao
2024-04-01 16:03:10 +08:00
committed by GitHub
parent 692e75627b
commit f9d266a6af

View File

@@ -37,7 +37,7 @@ export const getUploadModel = ({ maxSize = 500 }: { maxSize?: number }) => {
async doUpload<T = Record<string, any>>( async doUpload<T = Record<string, any>>(
req: NextApiRequest, req: NextApiRequest,
res: NextApiResponse, res: NextApiResponse,
originBuckerName?: `${BucketNameEnum}` originBucketName?: `${BucketNameEnum}`
) { ) {
return new Promise<{ return new Promise<{
file: FileType; file: FileType;
@@ -52,7 +52,7 @@ export const getUploadModel = ({ maxSize = 500 }: { maxSize?: number }) => {
} }
// check bucket name // check bucket name
const bucketName = (req.body?.bucketName || originBuckerName) as `${BucketNameEnum}`; const bucketName = (req.body?.bucketName || originBucketName) as `${BucketNameEnum}`;
if (bucketName && !bucketNameMap[bucketName]) { if (bucketName && !bucketNameMap[bucketName]) {
return reject('BucketName is invalid'); return reject('BucketName is invalid');
} }