continue: change verification upload section for corret upload last file and mark last chank

This commit is contained in:
smanylov
2026-04-13 13:44:30 +07:00
parent 8da7056cd6
commit 0182616050
4 changed files with 26 additions and 25 deletions
+7 -3
View File
@@ -116,9 +116,14 @@ export type ChunkResponse = {
fileId?: string
};
export async function chunkUpload(formData: FormData): Promise<ChunkResponse> {
export async function chunkUpload(formData: FormData, itPrivate?: boolean): Promise<ChunkResponse> {
console.log('chunkUpload');
try {
const response = await fetch(`${API_BASE_URL}/api/v1/files/chunk`, {
const url = itPrivate
? `${API_BASE_URL}/api/v1/private/files/chunk`
: `${API_BASE_URL}/api/v1/files/chunk`;
const response = await fetch(url, {
method: 'POST',
body: formData
});
@@ -254,7 +259,6 @@ export async function checkOperationPrice(action: string, filesCount: number, fi
if (response.ok) {
let parsed = await response.json();
console.log(parsed);
if (parsed.message_code === 0) {
return parsed.message_body;