убрать пробелы на _ в pdf верификации
This commit is contained in:
parent
160ec29f16
commit
0ad89dd05f
@ -72,6 +72,18 @@ export const updateDocuments = async (
|
|||||||
documents: UpdateDocumentsArgs
|
documents: UpdateDocumentsArgs
|
||||||
): Promise<[Verification | "OK" | null, string?]> => {
|
): Promise<[Verification | "OK" | null, string?]> => {
|
||||||
try {
|
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>({
|
const updateDocumentsResponse = await makeRequest<FormData, Verification>({
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
url: `${API_URL}`,
|
url: `${API_URL}`,
|
||||||
@ -93,6 +105,8 @@ export const updateDocuments = async (
|
|||||||
export const updateDocument = async (
|
export const updateDocument = async (
|
||||||
body: FormData
|
body: FormData
|
||||||
): Promise<[Verification | "OK" | null, string?]> => {
|
): Promise<[Verification | "OK" | null, string?]> => {
|
||||||
|
console.log("body")
|
||||||
|
console.log(body)
|
||||||
try {
|
try {
|
||||||
const updateDocumentResponse = await makeRequest<FormData, Verification>({
|
const updateDocumentResponse = await makeRequest<FormData, Verification>({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
|
@ -29,6 +29,7 @@ export const jsonToFormdata = (
|
|||||||
if (!key) continue
|
if (!key) continue
|
||||||
|
|
||||||
const value = json[key]
|
const value = json[key]
|
||||||
|
if (typeof value !== "string") value.name = value.name.replace(/\s/g, '_')
|
||||||
|
|
||||||
if (typeof value !== "string") {
|
if (typeof value !== "string") {
|
||||||
formData.append(key, convertBinaryStringToFile(value))
|
formData.append(key, convertBinaryStringToFile(value))
|
||||||
@ -38,6 +39,7 @@ export const jsonToFormdata = (
|
|||||||
|
|
||||||
formData.append(key, value)
|
formData.append(key, value)
|
||||||
}
|
}
|
||||||
|
console.log("formData")
|
||||||
|
console.log(formData)
|
||||||
return formData
|
return formData
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user