diff --git a/src/api/verification.ts b/src/api/verification.ts index c3d7cbe..ebb86d3 100644 --- a/src/api/verification.ts +++ b/src/api/verification.ts @@ -72,6 +72,18 @@ export const updateDocuments = async ( documents: UpdateDocumentsArgs ): Promise<[Verification | "OK" | null, string?]> => { try { + // .replace(/\s/g, '_') + // if (documents.inn) { + // documents.inn.append("name", "blob"); + // } + // if (documents.rule) { + // documents.rule.append("name", "blob"); + // } + // if (documents.certificate) { + // documents.certificate.append("name", "blob"); + // } + console.log("documents") + console.log(documents) const updateDocumentsResponse = await makeRequest({ method: "PUT", url: `${API_URL}`, @@ -93,6 +105,8 @@ export const updateDocuments = async ( export const updateDocument = async ( body: FormData ): Promise<[Verification | "OK" | null, string?]> => { + console.log("body") + console.log(body) try { const updateDocumentResponse = await makeRequest({ method: "PATCH", diff --git a/src/utils/jsonToFormdata.ts b/src/utils/jsonToFormdata.ts index 3267290..d6d987a 100644 --- a/src/utils/jsonToFormdata.ts +++ b/src/utils/jsonToFormdata.ts @@ -29,6 +29,7 @@ export const jsonToFormdata = ( if (!key) continue const value = json[key] + if (typeof value !== "string") value.name = value.name.replace(/\s/g, '_') if (typeof value !== "string") { formData.append(key, convertBinaryStringToFile(value)) @@ -38,6 +39,7 @@ export const jsonToFormdata = ( formData.append(key, value) } - +console.log("formData") +console.log(formData) return formData }