убрать пробелы на _ в pdf верификации

This commit is contained in:
Nastya 2024-08-28 23:16:59 +03:00
parent 160ec29f16
commit 0ad89dd05f
2 changed files with 17 additions and 1 deletions

@ -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<FormData, Verification>({
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<FormData, Verification>({
method: "PATCH",

@ -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
}