Merge branch 'staging' into preprod
This commit is contained in:
commit
bd189b30d1
@ -14,6 +14,7 @@ import classes from "./classes.module.scss";
|
||||
import ClientBox from "./ClientBox";
|
||||
import DocumentTables from "./DocumentTables";
|
||||
import EmailReminder from "./EmailReminder";
|
||||
import DocumentsNotary from "@Front/Api/LeCoffreApi/Notary/DocumentsNotary/DocumentsNotary";
|
||||
|
||||
type IProps = {
|
||||
folder: OfficeFolder;
|
||||
@ -57,8 +58,19 @@ export default function ClientView(props: IProps) {
|
||||
);
|
||||
|
||||
const handleClientDelete = useCallback(
|
||||
(customerUid: string) => {
|
||||
async (customerUid: string) => {
|
||||
if (!folder.uid) return;
|
||||
const documentsNotary = await DocumentsNotary.getInstance().get({
|
||||
where: { customer: { uid: customerUid }, folder: { uid: folder.uid } },
|
||||
});
|
||||
console.log(documentsNotary);
|
||||
|
||||
if (documentsNotary.length > 0) {
|
||||
documentsNotary.forEach(async (doc) => {
|
||||
await DocumentsNotary.getInstance().delete(doc.uid!);
|
||||
});
|
||||
}
|
||||
|
||||
Folders.getInstance().put(
|
||||
folder.uid,
|
||||
OfficeFolder.hydrate<OfficeFolder>({
|
||||
|
Loading…
x
Reference in New Issue
Block a user