add logs
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ import createNextIntlPlugin from 'next-intl/plugin';
|
||||
const nextConfig: NextConfig = {
|
||||
experimental: {
|
||||
serverActions: {
|
||||
bodySizeLimit: '6mb',
|
||||
bodySizeLimit: '50mb',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -102,14 +102,17 @@ export async function cancelUpload(udloadId: string) {
|
||||
}
|
||||
|
||||
export async function chunkUpload(formData: FormData) {
|
||||
console.log('chunkUpload');
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api/v1/files/chunk`, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
|
||||
console.log('chunkUpload fetch');
|
||||
if (response.ok) {
|
||||
let parsed = await response.json();
|
||||
console.log('chunkUpload response.ok');
|
||||
console.log(parsed);
|
||||
|
||||
if (parsed.message_desc === 'Upload cancelled successfully') {
|
||||
return parsed.message_body;
|
||||
|
||||
@@ -290,8 +290,9 @@ export default function UploadSectionFile({ fileType, allowedExtensions, maxFile
|
||||
formData.append('upload_id', response.upload_id);
|
||||
formData.append('chunk_number', chunkIndex.toString());
|
||||
formData.append('chunk', chunk);
|
||||
|
||||
console.log(`init chunkUpload`);
|
||||
const chunkResponse = await chunkUpload(formData);
|
||||
console.log(`chunkResponse - ${chunkResponse}`);
|
||||
|
||||
if (chunkResponse.message_desc !== 'Chunk uploaded successfully') {
|
||||
throw new Error('Er1: response error');
|
||||
@@ -327,6 +328,7 @@ export default function UploadSectionFile({ fileType, allowedExtensions, maxFile
|
||||
}
|
||||
} finally {
|
||||
setIsUploading(false);
|
||||
setUploadId(null);
|
||||
}
|
||||
}, [isUploading, fileType]); // Добавьте зависимости
|
||||
|
||||
|
||||
Reference in New Issue
Block a user