diff --git a/actions/dealsActions.js b/actions/dealsActions.js index 3797d44..bd3b91a 100644 --- a/actions/dealsActions.js +++ b/actions/dealsActions.js @@ -4,6 +4,7 @@ import Router from 'next/router'; import moment from 'moment'; import { nSQL } from "@nano-sql/core"; import { eachSeries } from 'async'; +import fileDownload from 'js-file-download'; import * as actionTypes from '../constants/actionTypes'; import * as currentState from '../reducers/initialState'; @@ -80,7 +81,7 @@ export const getDeals = ({ dispatch, update = false }) => export const getDealOffers = ({ dispatch, deal_id }) => { - const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/deals/offers`; + const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/deals/offer/list`; console.log("ACTION", "deals", "getDealOffers()", { url }); console.log("ACTION", "deals", "getDealOffers()", { deal_id }); @@ -122,6 +123,31 @@ export const getDealOffers = ({ dispatch, deal_id }) => }); } +export const downloadDealOffer = ({ quote_number, filename }) => +{ + return new Promise((resolve, reject) => + { + const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/deals/offer/download`; + + axios.get(url, { + params: { quote_number }, + responseType: 'blob', + }) + .then((response) => + { + fileDownload(response.data, filename); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "sign", "downloadDealOffer()", "ERROR"); + console.error(error); + + reject(error.data); + }); + }); +} + export const acceptDealOffers = ({ deal_id, offers }) => { const url = `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/deals/accept`; @@ -171,7 +197,7 @@ export const getDealDocuments = ({ dispatch, deal_id }) => data: { deal_id, documents: response.data.documents, - files: response.data.files, + uploaded: response.data.uploaded, } }); @@ -187,7 +213,7 @@ export const getDealDocuments = ({ dispatch, deal_id }) => data: { deal_id, documents: [], - files: {}, + uploaded: {}, } }); diff --git a/components/DealsStatus/SingleDeal.js b/components/DealsStatus/SingleDeal.js index 09270b9..246721d 100644 --- a/components/DealsStatus/SingleDeal.js +++ b/components/DealsStatus/SingleDeal.js @@ -1,13 +1,13 @@ import React from "react"; import numeral from "numeral"; import moment from "moment"; -import { eachLimit } from "async"; +import { eachLimit, eachSeries } from "async"; import { SpinnerCircular } from "spinners-react"; import FileDropzoneDeals from "../FileDropzoneDeals"; import EDOSign from "../../components/EDOSign"; -import { acceptDealOffers, attachDealDocument, docEDOCancel, docEDOStatus, getFile, removeDealDocument, sendDealDocuments, signDownloadFile, signGetFileContractProject } from "../../actions"; +import { acceptDealOffers, attachDealDocument, docEDOCancel, docEDOStatus, downloadDealOffer, getFile, removeDealDocument, sendDealDocuments, signDownloadFile, signGetFileContractProject } from "../../actions"; class Step extends React.Component { @@ -93,6 +93,13 @@ class Offers extends Step this.setState({ checked }); } + _handle_onOffer = (quote_number) => + { + downloadDealOffer({ quote_number, filename: `ЛК Эволюция КП №${ quote_number }.pdf` }) + .then(() => {}) + .catch(() => {}); + } + _handle_onSend = (event) => { event.preventDefault(); @@ -202,7 +209,7 @@ class Offers extends Step
@@ -274,7 +281,7 @@ class DocumentsForm extends Step super(props); this.state = { open: false, - files: {}, + uploaded: {}, uploading: false, completed: false, loading: true, @@ -282,6 +289,14 @@ class DocumentsForm extends Step this.status = 102; } + componentDidMount() + { + if(this.status === this.props.statuscode_id) + { + this.setState({ open: true, }); + } + } + componentDidUpdate(prevProps, prevState) { if(this.props.statuscode_id !== prevProps.statuscode_id) @@ -296,11 +311,12 @@ class DocumentsForm extends Step } } - if(prevProps.files !== this.props.files) + if(prevProps.uploaded !== this.props.uploaded) { - this.setState({ files: this.props.files, loading: false }, () => + this.setState({ uploaded: this.props.uploaded, loading: false }, () => { - this._checkFilesCompleted(); + const completed = this._checkFilesCompleted(); + this.setState({ completed }); }); } } @@ -323,7 +339,7 @@ class DocumentsForm extends Step }); }) - /* +/* const { files } = this.state; const files_array = []; @@ -332,7 +348,7 @@ class DocumentsForm extends Step for(let f in files[g]) { files_array.push(files[g][f]) - } + } } this.setState({ uploading: true }, () => @@ -362,24 +378,39 @@ class DocumentsForm extends Step this._checkFilesCompleted(); onDealsUpdate(); }); - }); + }); }); - */ +*/ } _onSendFileStats = (group, index) => { - const files = { ...this.state.files }; + return new Promise((resolve) => + { + const uploaded = { ...this.state.uploaded }; - files[group][index].sent = true; + uploaded[group].files[index].sent = true; - this.setState({ files }); + this.setState({ uploaded }, () => + { + resolve(); + }); + }) } - _handle_onAddFile = (document_id, files) => + _handle_onAddFile = (document_id, files, update) => { - const existed_files = this.state.files; - const document_files = existed_files[ document_id ] === undefined ? [] : existed_files[ document_id ]; + const existed_files = { ...this.state.uploaded }; + console.log("_handle_onAddFile", { existed_files }); + const document_files = existed_files[ document_id ] === undefined ? [] : existed_files[ document_id ].files; + + if(existed_files[ document_id ] === undefined) + { + existed_files[ document_id ] = { + sent: false, + files: [], + }; + } for(let nf in files) { @@ -394,65 +425,77 @@ class DocumentsForm extends Step files[nf].index = nf; files[nf].group = document_id; files[nf].sent = false; + files[nf].update = update; + document_files.push(files[nf]); } - existed_files[ document_id ] = document_files; + existed_files[ document_id ].sent = false; + existed_files[ document_id ].files = document_files; + } - this.setState({ files: existed_files }, () => + this.setState({ uploaded: existed_files, uploading: true }, () => + { + const { opp_number } = this.props; + + eachSeries(files, (file, callback) => { - const { opp_number } = this.props; - const payload = { deal_id: opp_number, - document_id: files[0].group, - filename: files[0].name, - index: files[0].index, - lastModified: files[0].lastModified, - file: files[0], - type: files[0].type, + document_id: file.group, + filename: file.name, + index: file.index, + lastModified: file.lastModified, + type: file.type, + file, + update, }; attachDealDocument(payload) - .then(() => + .then(async () => { - this._onSendFileStats(document_id, 0); - this._checkFilesCompleted(); + await this._onSendFileStats(document_id, file.index); + callback(); }, 1000) - //this._checkFilesCompleted(); + }, () => + { + const completed = this._checkFilesCompleted(); + this.setState({ uploading: false, completed }); }); - } + }); } _handle_onDeleteFile = (document_id, file) => { - const files = { ...this.state.files }; + const uploaded = { ...this.state.uploaded }; const { opp_number } = this.props; const list = []; - for(let i in files[document_id]) + for(let i in uploaded[document_id].files) { - if(files[document_id][i].name !== file.name) + if(uploaded[document_id].files[i].name !== file.name) { - list.push(files[document_id][i]); + list.push(uploaded[document_id].files[i]); } } if(list.length > 0) { - files[document_id] = list; + uploaded[document_id].files = list; } else { - delete files[document_id]; + delete uploaded[document_id]; } - this.setState({ files }, () => + this.setState({ uploaded }, () => { - this._checkFilesCompleted(); - - removeDealDocument({ deal_id: opp_number, document_id }); + const completed = this._checkFilesCompleted(); + this.setState({ completed }, () => + { + removeDealDocument({ deal_id: opp_number, document_id }); + }); }); } @@ -466,39 +509,44 @@ class DocumentsForm extends Step _checkFilesCompleted = () => { - const documents_length = this.props.documents.length; - const files_length = Object.keys(this.state.files).length; +// const documents_length = this.props.documents.length; +// const files_length = Object.keys(this.state.files).length; +// const c = files_length >= documents_length ? true : false; - const c = files_length >= documents_length ? true : false; - /* - const { files } = this.state; + const { uploaded } = this.state; const { documents } = this.props; let c = true; - for(let g in documents) + if(documents !== undefined) { - const group = documents[g].doc_id; + for(let g in documents) + { + const group = documents[g].doc_id; - if(files[group] === undefined || files[group].length === 0) - { - c = false; - break; - } - else - { - for(let f in files[group]) + if(uploaded[group] === undefined || uploaded[group].files.length === 0) { - if(!files[group][f].sent) + c = false; + break; + } + else + { + for(let f in uploaded[group].files) { - c = false; - break; + if(!uploaded[group].files[f].sent) + { + c = false; + break; + } } } } } - */ + else + { + c = false; + } - this.setState({ completed: c }); + return c; } _renderHeaderButtons = () => @@ -506,13 +554,13 @@ class DocumentsForm extends Step const { open, uploading, completed, loading, } = this.state; const { statuscode_id } = this.props; - if(open && !uploading && !loading && completed) + if(open && !uploading && !loading) { if(this.status === statuscode_id) { return (
+ { document.check } + { document.comment } +
+- { document.check } - { document.comment } -
-diff --git a/css/main/style.css b/css/main/style.css index 6a845dd..18fda36 100644 --- a/css/main/style.css +++ b/css/main/style.css @@ -6072,6 +6072,10 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_ padding: 30px; height: 100px; } +.horizontal_dropzone_wrapper.disabled { + filter: grayscale(1); + opacity: 0.25; +} .horizontal_dropzone_wrapper .horizontal_dropzone_inner { display: flex; width: 100%; @@ -6163,12 +6167,15 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block .block_body .fines_ .horizontal_dropzone_files_wrapper { width: 100%; display: flex; - flex-direction: row; + flex-direction: column; gap: 0px 20px; padding-top: 15px; } .horizontal_dropzone_files_wrapper .horizontal_dropzone_files_item { - width: 50%; + width: 100%; +} +.horizontal_dropzone_files_wrapper .horizontal_dropzone_files_error { + padding-bottom: 24px; } .horizontal_dropzone_files_comment { background: rgba(131, 3, 84, 0.1); diff --git a/css/main/style.less b/css/main/style.less index 4ca95ee..dd89e2b 100644 --- a/css/main/style.less +++ b/css/main/style.less @@ -6982,8 +6982,13 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block { .horizontal_dropzone_wrapper { margin: 0px; - padding: 30px; - height: 100px; + padding: 30px; + height: 100px; + + &.disabled { + filter: grayscale(1); + opacity: 0.25; + } .horizontal_dropzone_inner { display: flex; @@ -7092,12 +7097,16 @@ main .dropdown_blocks_list.zero-margin.gibdd .dropdown_block { .horizontal_dropzone_files_wrapper { width: 100%; display: flex; - flex-direction: row; + flex-direction: column; gap: 0px 20px; padding-top: 15px; - + .horizontal_dropzone_files_item { - width: 50%; + width: 100%; + } + + .horizontal_dropzone_files_error { + padding-bottom: 24px; } } diff --git a/pages/api/deals/documents.js b/pages/api/deals/documents.js index 0e706ea..5587f0b 100644 --- a/pages/api/deals/documents.js +++ b/pages/api/deals/documents.js @@ -45,6 +45,7 @@ export default async function handler(req, res) console.log({ key }) var files = {}; + var uploaded = {}; if(deals !== null) { deals = JSON.parse(deals); @@ -52,10 +53,11 @@ export default async function handler(req, res) if(deals[ deal_id ] !== undefined) { files = deals[ deal_id ].files; + uploaded = deals[ deal_id ].uploaded; } } - res.status(200).send({ documents, files }); + res.status(200).send({ documents, files, uploaded, }); resolve(); }) .catch((error) => diff --git a/pages/api/deals/file/attach.js b/pages/api/deals/file/attach.js index 40316d0..ba53a59 100644 --- a/pages/api/deals/file/attach.js +++ b/pages/api/deals/file/attach.js @@ -34,9 +34,9 @@ export default async function handler(req, res) upload.single("file")(req, {}, async (err) => { const { file, } = req; - const { deal_id, document_id, type, index, lastModified } = req.query; + const { deal_id, document_id, type, index, lastModified, } = req.query; - const local_filename = `${ client_jwt_decoded.acc_number }_${ deal_id }_${ document_id }`; + const local_filename = `${ client_jwt_decoded.acc_number }_${ deal_id }_${ document_id }_${ index }`; const file_payload = { name: Buffer.from(file.originalname, 'latin1').toString('utf8'), @@ -57,14 +57,16 @@ export default async function handler(req, res) const key = `deals_${ client_jwt_decoded.acc_number }`; var deals = await RedisClient.get(key); - var files = {}; + var uploaded = {}; + //var files = {}; if(deals !== null) { deals = JSON.parse(deals); if(deals[ deal_id ] !== undefined) { - files = deals[ deal_id ].files; + //files = deals[ deal_id ].files; + uploaded = deals[ deal_id ].uploaded; } } else @@ -72,6 +74,23 @@ export default async function handler(req, res) deals = {}; } + if(uploaded !== undefined) + { + if(uploaded[ document_id ] !== undefined) + { + uploaded[ document_id ].sent = false; + uploaded[ document_id ].files.push(file_payload); + } + else + { + uploaded[ document_id ] = { + sent: false, + files: [ file_payload ], + } + } + } + + /* if(files[ document_id ] !== undefined) { files[ document_id ].push(file_payload); @@ -80,9 +99,10 @@ export default async function handler(req, res) { files[ document_id ] = [ file_payload ]; } + */ //files[ document_id ] = [ file_payload ]; - deals[ deal_id ] = { files }; + deals[ deal_id ] = { uploaded }; await RedisClient.set(key, JSON.stringify(deals)); diff --git a/pages/api/deals/file/remove.js b/pages/api/deals/file/remove.js index 4b2321f..f7f10c0 100644 --- a/pages/api/deals/file/remove.js +++ b/pages/api/deals/file/remove.js @@ -46,6 +46,7 @@ export default async function handler(req, res) const key = `deals_${ client_jwt_decoded.acc_number }`; var deals = await RedisClient.get(key); + var uploaded = {}; var files = {}; if(deals !== null) { @@ -53,7 +54,8 @@ export default async function handler(req, res) if(deals[ deal_id ] !== undefined) { - files = deals[ deal_id ].files; + //files = deals[ deal_id ].files; + uploaded = deals[ deal_id ].uploaded; } } else @@ -61,8 +63,19 @@ export default async function handler(req, res) deals = {}; } - files[ document_id ].splice(index, 1); - deals[ deal_id ] = { files }; + if(uploaded !== undefined) + { + if(uploaded[ document_id ] !== undefined) + { + if(uploaded[ document_id ].files !== undefined) + { + uploaded[ document_id ].sent = false; + uploaded[ document_id ].files.splice(index, 1); + } + } + } + + deals[ deal_id ] = { uploaded }; await RedisClient.set(key, JSON.stringify(deals)); } diff --git a/pages/api/deals/offer/download.js b/pages/api/deals/offer/download.js new file mode 100644 index 0000000..bea39f5 --- /dev/null +++ b/pages/api/deals/offer/download.js @@ -0,0 +1,82 @@ +import fs from 'fs'; +import axios from 'axios'; +import { Cookies } from 'react-cookie'; +import cookie from 'cookie'; +import moment from 'moment'; +import jwt from 'jsonwebtoken'; +import { inspect } from 'util'; + +import { cors } from '../../../../lib/cors'; + +export default async function handler(req, res) +{ + console.log("API", "DEALS", "/offer/download"); + + await cors(req, res); + + const { quote_number, } = req.query; + + return new Promise(async (resolve) => + { + if(req.headers.cookie !== undefined) + { + const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : ""); + + if(cookies.jwt !== undefined && cookies.jwt !== null) + { + var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT); + var crm_jwt = jwt.sign({ acc_number: client_jwt_decoded.acc_number }, process.env.JWT_SECRET_CRM, { noTimestamp: true }); + + const payload = { + quote_number, + acc_number: client_jwt_decoded.acc_number, + }; + + console.log({ payload }); + + try + { + axios.get(`${ process.env.CRM_API_HOST }/lk/ConsiderationOpportunity/quote/offerprintform`, { + params: payload, + responseType: 'arraybuffer', + headers: { + "Authorization": `Bearer ${ crm_jwt }`, + "Content-Type": "application/json", + }, + }) + .then((crm_response) => + { + console.log("API", "DEALS", "/offer/download", "RESPONSE"); + res.status(200).send(crm_response.data); + resolve(); + }) + .catch((error) => + { + console.error("API", "DEALS", "/offer/download", "ERROR"); + console.error(error); + console.error(error.data); + + res.status(500).send(error.data); + resolve(); + }); + } + catch(e) + { + console.error(e); + res.status(500).send(e); + resolve(); + } + } + else + { + res.status(403).send(); + resolve(); + } + } + else + { + res.status(403).send(); + resolve(); + } + }); +} \ No newline at end of file diff --git a/pages/api/deals/offer/list.js b/pages/api/deals/offer/list.js new file mode 100644 index 0000000..77868fc --- /dev/null +++ b/pages/api/deals/offer/list.js @@ -0,0 +1,17 @@ +/* +2.7.2 - Метод получения списка Предложений по Лизинговой сделке в CRM +GET /lk/ConsiderationOpportunity/quote +*/ + +import CRMRequestGet from '../../../../lib/CRMRequestGet'; + +export default async function handler(req, res) +{ + console.log("API", "DEALS", "offers"); + console.log(req.body); + console.log("-".repeat(50)); + + const { deal_id } = req.body; + + await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/ConsiderationOpportunity/quote`, params: { ...{ opp_number: deal_id } } }); +} \ No newline at end of file diff --git a/pages/api/deals/upload.js b/pages/api/deals/upload.js index ed3c5df..1c3d338 100644 --- a/pages/api/deals/upload.js +++ b/pages/api/deals/upload.js @@ -11,7 +11,8 @@ import jwt from 'jsonwebtoken'; import { inspect } from 'util'; import FormData from 'form-data'; import multer from 'multer'; -import { eachLimit } from 'async'; +import { eachLimit, eachSeries } from 'async'; +import archiver from 'archiver'; import { cors } from '../../../lib/cors'; import RedisClient from '../../../lib/RedisClient'; @@ -25,6 +26,98 @@ function uploadFiles() } */ +function createZipFile(zip_filename, files) +{ + return new Promise(async (resolve) => + { + const output = fs.createWriteStream(zip_filename); + const archive = archiver('zip', { + zlib: { level: 9 } // Sets the compression level. + }); + + output.on('end', function() + { + console.log('Data has been drained'); + }); + + archive.on('warning', function(err) + { + if (err.code === 'ENOENT') + { + } else { + throw err; + } + }); + + archive.on('error', function(err) + { + throw err; + }); + + archive.pipe(output); + + for(let i in files) + { + archive.append(fs.createReadStream(files[i].path), { name: files[i].name }); + } + await archive.finalize(); + + resolve(); + }); +} + +function uploadFile({ deal_id, filename, name, group, crm_jwt }) +{ + return new Promise((resolve) => + { + if(fs.existsSync(`${ uploads }${ filename }`)) + { + const path = `${ uploads }${ filename }`; + + const file_to_send_data = fs.readFileSync(path); + console.log({ filename, len: file_to_send_data.length, path }); + + const data = new FormData(); + data.append("file", file_to_send_data, name); + + const payload = new URLSearchParams({ + name: deal_id, + entity: "opportunity", + documentTypeNumber: group, + documentName: name, + }); + + const file_upload_url = `${ process.env.CRM_API_HOST }/lk/document/upload?${ payload.toString() }`; + console.log( file_upload_url ); + + axios.post(file_upload_url, data, + { + headers: { + "Content-Type": `multipart/form-data; boundary=${ data._boundary }`, + "Authorization": `Bearer ${ crm_jwt }`, + }, + withCredentials: true, + }) + .then(() => + { + console.log("FILE", filename, "SENT"); + resolve(); + }) + .catch((error) => + { + console.error("FILE", filename, "ERROR"); + console.error(error); + + resolve(); + }); + } + else + { + resolve(); + } + }); +} + export default async function handler(req, res) { await cors(req, res); @@ -53,68 +146,86 @@ export default async function handler(req, res) if(deals[ deal_id ] !== undefined) { - for(let i in deals[ deal_id ].files) - { - files.push(deals[ deal_id ].files[i]); - } + //for(let i in deals[ deal_id ].uploaded.files) + //{ + // files.push(deals[ deal_id ].uploaded.files[i]); + //} - console.log({ files }); - console.log(files[0]) - - eachLimit(files, 5, (file_entry, callback) => + eachSeries(Object.keys(deals[ deal_id ].uploaded), (group, callback) => { - const file = file_entry[0]; - try + const document = deals[ deal_id ].uploaded[ group ]; + console.log({ group, document }); + + if(document.files.length === 1) { - if(fs.existsSync(`${ uploads }${ file.filename }`)) + const file = document.files[0]; + + uploadFile({ deal_id, filename: file.filename, name: file.name, group, crm_jwt }) + .then(() => { - const file_to_send_data = fs.readFileSync(`${ uploads }${ file.filename }`); - const data = new FormData(); - data.append("file", file_to_send_data, file.name); + callback(); + }); + } + else + { + let files_to_zip = []; + for(let f in document.files) + { + const file = document.files[f]; + const ext_regex = new RegExp("\.([0-9a-z]+)$", "i"); + const ext = file.name.match(ext_regex); - const payload = new URLSearchParams({ - name: deal_id, - entity: "opportunity", - documentTypeNumber: file.group, - documentName: file.name, + files_to_zip.push({ + name: `${ file.name }`, + path: `${ uploads }${ file.filename }`, }); + } - const file_upload_url = `${ process.env.CRM_API_HOST }/lk/document/upload?${ payload.toString() }`; - console.log( file_upload_url ); - - axios.post(file_upload_url, data, - { - headers: { - "Content-Type": `multipart/form-data; boundary=${ data._boundary }`, - "Authorization": `Bearer ${ crm_jwt }`, - }, - withCredentials: true, - }) + const zip_filename = `${ client_jwt_decoded.acc_number }_${ deal_id }_${ group }.zip`; + + console.log({ files_to_zip }); + + createZipFile(`${ uploads }${ zip_filename }`, files_to_zip) + .then(() => + { + uploadFile({ deal_id, filename: zip_filename, name: zip_filename, group, crm_jwt }) .then(() => { - console.log("FILE", file.filename, "SENT"); callback(); - }) - .catch(() => - { - callback(); - }); + }); + }) + } + + /* + try + { + + + if(fs.existsSync(`${ uploads }${ file.filename }`)) + { + */ + /* + + */ + /* } else { callback(); } + */ /* console.log({ file_upload_url }); - */ + /* } catch(e) { console.error(e) callback(); } + */ }, () => { console.log("ALL FILES SENT"); diff --git a/pages/contract/change/components/Options/index.js b/pages/contract/change/components/Options/index.js index 299c087..042f1df 100644 --- a/pages/contract/change/components/Options/index.js +++ b/pages/contract/change/components/Options/index.js @@ -660,7 +660,7 @@ export default class Options extends React.Component if(number_paydate !== null) { selected.number_paydate = moment(number_paydate).format(); } if(period_new !== null) { selected.period_new = period_new; } - //if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; } +if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; } if(date_offset_type !== null) { selected.date_offset_type = date_offset_type; } if(sum !== null) { selected.sum = sum; } if(insurance_price_result !== null) { selected.insurance_price_result = insurance_price_result; } diff --git a/reducers/dealsReducer.js b/reducers/dealsReducer.js index 56019b6..3598124 100644 --- a/reducers/dealsReducer.js +++ b/reducers/dealsReducer.js @@ -55,7 +55,7 @@ const dealsReducer = (state = initialState.deals, action) => console.log("ACTION", actionTypes.DEAL_DOCUMENTS_LIST, { action }); const details = state.details; - details[action.data.deal_id] = { ...details[action.data.deal_id], ...{ documents: action.data.documents, files: action.data.files } }; + details[action.data.deal_id] = { ...details[action.data.deal_id], ...{ documents: action.data.documents, uploaded: action.data.uploaded } }; return { ...state,