Merge branch 'dev' into staging
This commit is contained in:
commit
f109531c27
@ -12,6 +12,7 @@ import { useCallback } from "react";
|
|||||||
import { AnchorStatus } from "../..";
|
import { AnchorStatus } from "../..";
|
||||||
import classes from "./classes.module.scss";
|
import classes from "./classes.module.scss";
|
||||||
import DeleteCustomerModal from "./DeleteCustomerModal";
|
import DeleteCustomerModal from "./DeleteCustomerModal";
|
||||||
|
import Documents from "@Front/Api/LeCoffreApi/Notary/Documents/Documents";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
customer: Customer;
|
customer: Customer;
|
||||||
@ -28,8 +29,12 @@ export default function ClientBox(props: IProps) {
|
|||||||
const { isOpen: isErrorModalOpen, open: openErrorModal, close: closeErrorModal } = useOpenable();
|
const { isOpen: isErrorModalOpen, open: openErrorModal, close: closeErrorModal } = useOpenable();
|
||||||
|
|
||||||
const handleDelete = useCallback(
|
const handleDelete = useCallback(
|
||||||
(customerUid: string) => {
|
async (customerUid: string) => {
|
||||||
if (customer.documents && customer.documents.length > 0) {
|
console.log(customer);
|
||||||
|
const documents = await Documents.getInstance().get({ where: { depositor_uid: customerUid, folder_uid: folderUid } });
|
||||||
|
console.log(documents);
|
||||||
|
|
||||||
|
if (documents && documents.length > 0) {
|
||||||
closeDeleteModal();
|
closeDeleteModal();
|
||||||
openErrorModal();
|
openErrorModal();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user