Skip to content

Commit

Permalink
Fix document upload handling for Outreach view
Browse files Browse the repository at this point in the history
closes #82

Signed-off-by: Sean Sundberg <[email protected]>
  • Loading branch information
seansund committed Sep 24, 2023
1 parent 3700d51 commit e174d35
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/views/KYC/KYCCaseDetail/KYCCaseOutreach/KYCCaseOutreach.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Button, Checkbox, FileUploader, Form, TextInput} from "@carbon/react";

import './KYCCaseOutreach.scss';
import {CountrySelect, DocumentList, EntityTypeSelect, IndustryTypeSelect, Stack} from "../../../../components";
import {ApproveCaseModel, createEmptyApproveCase, KycCaseModel,} from "../../../../models";
import {ApproveCaseModel, createEmptyApproveCase, DocumentModel, KycCaseModel,} from "../../../../models";
import {KycCaseManagementApi, kycCaseManagementApi} from "../../../../services";
import {handleFileUploaderChange} from "../util";
import {leftOuter} from "../../../../utils";
Expand Down Expand Up @@ -40,6 +40,12 @@ export const KYCCaseOutreach: React.FunctionComponent<KYCCaseReviewProps> = (pro
navigate(props.returnUrl);
}

const handleDocuments = (newDocuments: DocumentModel[]) => {
const documents = updatedCase.documents.concat(newDocuments)

setUpdatedCase(Object.assign({}, updatedCase, {documents}))
}


return (
<Form onSubmit={handleSubmit}>
Expand Down Expand Up @@ -105,7 +111,7 @@ export const KYCCaseOutreach: React.FunctionComponent<KYCCaseReviewProps> = (pro
multiple={true}
disabled={false}
iconDescription="Delete file"
onChange={handleFileUploaderChange(props.currentCase.id, updatedCase, setUpdatedCase, setFileStatus)}
onChange={handleFileUploaderChange(props.currentCase.id, handleDocuments, setFileStatus, 'data-extraction')}
name="" />
<div><Button kind="tertiary" onClick={handleCancel}>Cancel</Button> <Button type="submit">Submit</Button></div>
</Stack>
Expand Down

0 comments on commit e174d35

Please sign in to comment.