continue: change verification upload section for corret upload last file and mark last chank
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user