delete unused api calls
This commit is contained in:
parent
cd05e2dde0
commit
1a8439a2a6
@ -1,49 +0,0 @@
|
|||||||
import BaseNotary from "../BaseCustomer";
|
|
||||||
import User from "le-coffre-resources/dist/Notary";
|
|
||||||
|
|
||||||
export default class Users extends BaseNotary {
|
|
||||||
private static instance: Users;
|
|
||||||
private readonly baseURl = this.namespaceUrl.concat("/Users");
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getInstance() {
|
|
||||||
if (!this.instance) {
|
|
||||||
return new Users();
|
|
||||||
} else {
|
|
||||||
return this.instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async get(): Promise<User[]> {
|
|
||||||
const url = new URL(this.baseURl);
|
|
||||||
try {
|
|
||||||
return await this.getRequest<User[]>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getOne(uid: string): Promise<User> {
|
|
||||||
const url = new URL(this.baseURl.concat("/").concat(uid));
|
|
||||||
try {
|
|
||||||
return await this.getRequest<User>(url);
|
|
||||||
} catch (err) {
|
|
||||||
this.onError(err);
|
|
||||||
return Promise.reject(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// public async post(params: User): Promise<User> {
|
|
||||||
// const url = new URL(this.baseURl);
|
|
||||||
// try {
|
|
||||||
// return await this.postRequest<User>(url, params);
|
|
||||||
// } catch (err) {
|
|
||||||
// this.onError(err);
|
|
||||||
// return Promise.reject(err);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
@ -30,7 +30,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 } });
|
||||||
|
console.log(folder)
|
||||||
const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId);
|
const actualCustomer = folder?.customers?.find((customer) => customer.uid === jwt?.customerId);
|
||||||
if(!actualCustomer) throw new Error("Customer not found");
|
if(!actualCustomer) throw new Error("Customer not found");
|
||||||
|
|
||||||
@ -67,7 +67,6 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
}, [folderUid, getDocuments]);
|
}, [folderUid, getDocuments]);
|
||||||
|
|
||||||
const renderHeader = useCallback(() => {
|
const renderHeader = useCallback(() => {
|
||||||
console.log("Dossier : ", customer);
|
|
||||||
return (
|
return (
|
||||||
<div className={classes["header"]}>
|
<div className={classes["header"]}>
|
||||||
<div className={classes["text-container"]}>
|
<div className={classes["text-container"]}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user