Merge Dev in Staging
This commit is contained in:
commit
057b85a9a8
@ -31,7 +31,7 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
const folder = await Folders.getInstance().getByUid(folderUid as string, { q: { office: true, customers: true } });
|
||||||
const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId);
|
const actualCustomer = folder?.customers?.find((customer) => customer.contact?.email === jwt?.email);
|
||||||
if (!actualCustomer) throw new Error("Customer not found");
|
if (!actualCustomer) throw new Error("Customer not found");
|
||||||
|
|
||||||
const query: IGetDocumentsparams = {
|
const query: IGetDocumentsparams = {
|
||||||
@ -41,6 +41,16 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
document_history: true,
|
document_history: true,
|
||||||
document_type: true,
|
document_type: true,
|
||||||
depositor: true,
|
depositor: true,
|
||||||
|
folder: {
|
||||||
|
include: {
|
||||||
|
customers: {
|
||||||
|
include: {
|
||||||
|
contact: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
|||||||
a.style.display = "none";
|
a.style.display = "none";
|
||||||
a.href = url;
|
a.href = url;
|
||||||
// the filename you want
|
// the filename you want
|
||||||
a.download = `anchoring_proof_${this.props.selectedFolder?.folder_number}_${this.props.selectedFolder?.name}.pdf`;
|
a.download = `anchoring_proof_${this.props.selectedFolder?.folder_number}_${this.props.selectedFolder?.name}.zip`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
@ -18,13 +18,16 @@ export default function SelectFolder() {
|
|||||||
async function getFolders() {
|
async function getFolders() {
|
||||||
const jwt = JwtService.getInstance().decodeCustomerJwt();
|
const jwt = JwtService.getInstance().decodeCustomerJwt();
|
||||||
if (!jwt) return;
|
if (!jwt) return;
|
||||||
|
console.log(jwt)
|
||||||
|
|
||||||
const folders = await Folders.getInstance().get({
|
const folders = await Folders.getInstance().get({
|
||||||
q: {
|
q: {
|
||||||
where: {
|
where: {
|
||||||
customers: {
|
customers: {
|
||||||
some: {
|
some: {
|
||||||
uid: jwt.customerId || (jwt as any).customerId,
|
contact: {
|
||||||
|
email: jwt.email,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -33,6 +36,9 @@ export default function SelectFolder() {
|
|||||||
created_at: "desc",
|
created_at: "desc",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
include: {
|
||||||
|
customers: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setFolders(folders);
|
setFolders(folders);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user