✨ Fixing getters
This commit is contained in:
parent
f57443a811
commit
324429c988
@ -1,4 +1,3 @@
|
||||
|
||||
import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||
import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
@ -9,12 +8,11 @@ import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||
import WindowStore from "@Front/Stores/WindowStore";
|
||||
import classNames from "classnames";
|
||||
import { OfficeFolder } from "le-coffre-resources/dist/Customer";
|
||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
||||
import Image from "next/image";
|
||||
import React, { ReactNode } from "react";
|
||||
|
||||
import classes from "./classes.module.scss";
|
||||
import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus";
|
||||
|
||||
|
||||
type IProps = {
|
||||
title: string;
|
||||
@ -118,18 +116,14 @@ export default class DefaultNotaryDashboard extends React.Component<IProps, ISta
|
||||
include: {
|
||||
deed: { include: { deed_type: true } },
|
||||
office: true,
|
||||
office_folder_has_customers: {
|
||||
customers: {
|
||||
include: {
|
||||
customer: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2,12 +2,14 @@ import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers";
|
||||
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import Form from "@Front/Components/DesignSystem/Form";
|
||||
import { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||
import MultiSelect from "@Front/Components/DesignSystem/MultiSelect";
|
||||
import RadioBox from "@Front/Components/DesignSystem/RadioBox";
|
||||
import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography";
|
||||
import BackArrow from "@Front/Components/Elements/BackArrow";
|
||||
import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard";
|
||||
import Module from "@Front/Config/Module";
|
||||
import { TextField } from "@mui/material";
|
||||
import { ECivility } from "le-coffre-resources/dist/Customer/Contact";
|
||||
import { Customer, OfficeFolder } from "le-coffre-resources/dist/Notary";
|
||||
import Link from "next/link";
|
||||
@ -15,8 +17,6 @@ import { NextRouter, useRouter } from "next/router";
|
||||
|
||||
import BasePage from "../../Base";
|
||||
import classes from "./classes.module.scss";
|
||||
import { IOption } from "@Front/Components/DesignSystem/Form/SelectField";
|
||||
import { TextField } from "@mui/material";
|
||||
|
||||
enum ESelectedOption {
|
||||
EXISTING_CUSTOMER = "existing_customer",
|
||||
@ -108,10 +108,7 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
||||
<TextField name="last_name" placeholder="Nom" />
|
||||
<TextField name="first_name" placeholder="Prénom" />
|
||||
<TextField name="email" placeholder="E-mail" />
|
||||
<TextField
|
||||
name="cell_phone_number"
|
||||
placeholder="Numéro de téléphone"
|
||||
/>
|
||||
<TextField name="cell_phone_number" placeholder="Numéro de téléphone" />
|
||||
<div className={classes["button-container"]}>
|
||||
<Link href={backwardPath} className={classes["cancel-button"]}>
|
||||
<Button variant={EButtonVariant.GHOST}>Annuler</Button>
|
||||
@ -150,13 +147,9 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
||||
private async getFolderPreSelectedCustomers(folderUid: string): Promise<IOption[] | undefined> {
|
||||
const query = {
|
||||
q: {
|
||||
office_folder_has_customers: {
|
||||
customers: {
|
||||
include: {
|
||||
customer: {
|
||||
include: {
|
||||
contact: true,
|
||||
},
|
||||
},
|
||||
contact: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -224,9 +217,11 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
||||
}
|
||||
|
||||
if (customersToLink) {
|
||||
const body = OfficeFolder.hydrate<OfficeFolder>({ customers: customersToLink.map((customer) => {
|
||||
return Customer.hydrate<Customer>(customer);
|
||||
}) });
|
||||
const body = OfficeFolder.hydrate<OfficeFolder>({
|
||||
customers: customersToLink.map((customer) => {
|
||||
return Customer.hydrate<Customer>(customer);
|
||||
}),
|
||||
});
|
||||
|
||||
await Folders.getInstance().put(this.props.selectedFolderUid, body);
|
||||
this.props.router.push(`/folders/${this.props.selectedFolderUid}`);
|
||||
|
@ -2,6 +2,7 @@ import ChevronIcon from "@Assets/Icons/chevron.svg";
|
||||
import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders";
|
||||
import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button";
|
||||
import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation";
|
||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||
import Confirm from "@Front/Components/DesignSystem/Modal/Confirm";
|
||||
import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar";
|
||||
import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||
@ -16,7 +17,6 @@ import { ChangeEvent } from "react";
|
||||
import BasePage from "../../Base";
|
||||
import classes from "./classes.module.scss";
|
||||
import ClientSection from "./ClientSection";
|
||||
import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField";
|
||||
|
||||
type IProps = {};
|
||||
|
||||
@ -189,18 +189,14 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
q: {
|
||||
deed: { include: { deed_type: true } },
|
||||
office: true,
|
||||
office_folder_has_customers: {
|
||||
customer: {
|
||||
include: {
|
||||
customer: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
contact: true,
|
||||
documents: {
|
||||
include: {
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
folder: true,
|
||||
document_type: true,
|
||||
files: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -104,13 +104,9 @@ class UpdateFolderCollaboratorsClass extends BasePage<IPropsClass, IState> {
|
||||
const query = {
|
||||
q: {
|
||||
office: true,
|
||||
office_folder_has_stakeholder: {
|
||||
stakeholders: {
|
||||
include: {
|
||||
user_stakeholder: {
|
||||
include: {
|
||||
contact: true,
|
||||
},
|
||||
},
|
||||
contact: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -103,7 +103,7 @@ class UpdateFolderMetadataClass extends BasePage<IPropsClass, IState> {
|
||||
q: {
|
||||
deed: { include: { deed_type: true } },
|
||||
office: true,
|
||||
office_folder_has_customers: { include: { customer: { include: { contact: true } } } },
|
||||
customers: { include: { contact: true } },
|
||||
},
|
||||
};
|
||||
const folder = await Folders.getInstance().getByUid(this.props.folderUid, query);
|
||||
|
@ -140,7 +140,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
q: {
|
||||
deed: { include: { deed_type: "true" } },
|
||||
office: "true",
|
||||
office_folder_has_customers: { include: { customer: { include: { contact: true } } } },
|
||||
customer: { include: { contact: true } },
|
||||
},
|
||||
};
|
||||
const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query);
|
||||
|
Loading…
x
Reference in New Issue
Block a user