ajanin #5

Merged
ajanin merged 2 commits from ajanin into cicd 2025-07-09 18:36:28 +00:00
3 changed files with 8 additions and 3 deletions
Showing only changes of commit 09a2c85119 - Show all commits

View File

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

View File

@ -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) {

View File

@ -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) {