Fix some issues
This commit is contained in:
parent
ed4b797230
commit
09a2c85119
@ -51,7 +51,11 @@ export default function DefaultCustomerDashboard(props: IProps) {
|
||||
if (props.isReady) {
|
||||
FolderService.getFolders().then((processes: any[]) => {
|
||||
if (processes.length > 0) {
|
||||
const folders: any[] = processes.map((process: any) => process.processData);
|
||||
let folders: any[] = processes.map((process: any) => process.processData);
|
||||
|
||||
// Filter By customer.uid
|
||||
folders = folders.filter((folder: any) => folder.customers.some((customer: any) => customer.uid === profileUid));
|
||||
|
||||
setFolders(folders);
|
||||
}
|
||||
});
|
||||
|
@ -115,7 +115,7 @@ export default function ReceivedDocuments() {
|
||||
let documents: any[] = processes.map((process: any) => process.processData);
|
||||
|
||||
// FilterBy folder.uid & customer.uid
|
||||
documents = documents.filter((document: any) => document.folder.uid === folderUid && document.customer && document.customer.uid === customerUid);
|
||||
documents = documents.filter((document: any) => document.folder.uid === folderUid && document.customer /*&& document.customer.uid === customerUid*/);
|
||||
|
||||
for (const document of documents) {
|
||||
if (document.files && document.files.length > 0) {
|
||||
|
@ -139,6 +139,7 @@ export default function ClientDashboard(props: IProps) {
|
||||
|
||||
const fetchDocuments = useCallback(
|
||||
async (customerUid: string | undefined) => {
|
||||
setDocuments([]);
|
||||
LoaderService.getInstance().show();
|
||||
return new Promise<void>((resolve: () => void) => {
|
||||
DocumentService.getDocuments().then(async (processes: any[]) => {
|
||||
@ -179,9 +180,9 @@ export default function ClientDashboard(props: IProps) {
|
||||
*/
|
||||
|
||||
useEffect(() => {
|
||||
setDocumentsNotary([]);
|
||||
const customerUid = customer?.uid;
|
||||
if (!folderUid || !customerUid) return;
|
||||
|
||||
LoaderService.getInstance().show();
|
||||
DocumentService.getDocuments().then(async (processes: any[]) => {
|
||||
if (processes.length > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user