🐛 fixing console log
This commit is contained in:
parent
fd5b2cecec
commit
82d10c8f9c
@ -19,7 +19,7 @@ export default class Auth extends BaseApiService {
|
||||
try {
|
||||
return await fetch(url);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.error(err);
|
||||
this.onError(err);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
@ -27,7 +27,11 @@ export default class Auth extends BaseApiService {
|
||||
|
||||
public async loginWithIdNot() {
|
||||
const variables = FrontendVariables.getInstance();
|
||||
const url = new URL(`${variables.IDNOT_BASE_URL + variables.IDNOT_AUTHORIZE_ENDPOINT}?client_id=${variables.IDNOT_CLIENT_ID}&redirect_uri=${variables.FRONT_APP_HOST}/authorized-client&scope=openid,profile&response_type=code`);
|
||||
const url = new URL(
|
||||
`${variables.IDNOT_BASE_URL + variables.IDNOT_AUTHORIZE_ENDPOINT}?client_id=${variables.IDNOT_CLIENT_ID}&redirect_uri=${
|
||||
variables.FRONT_APP_HOST
|
||||
}/authorized-client&scope=openid,profile&response_type=code`,
|
||||
);
|
||||
try {
|
||||
return await this.getRequest(url);
|
||||
} catch (err) {
|
||||
@ -36,16 +40,15 @@ export default class Auth extends BaseApiService {
|
||||
}
|
||||
}
|
||||
|
||||
public async getIdnotJwt(autorizationCode: string | string[]): Promise<{accessToken: string, refreshToken: string}> {
|
||||
public async getIdnotJwt(autorizationCode: string | string[]): Promise<{ accessToken: string; refreshToken: string }> {
|
||||
const variables = FrontendVariables.getInstance();
|
||||
const baseBackUrl = variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
|
||||
const url = new URL(`${baseBackUrl}/api/v1/idnot/user/${autorizationCode}`);
|
||||
try {
|
||||
return await this.postRequest<{accessToken: string, refreshToken: string}>(url);
|
||||
return await this.postRequest<{ accessToken: string; refreshToken: string }>(url);
|
||||
} catch (err) {
|
||||
this.onError(err);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -421,7 +421,6 @@ export default class DepositDocument extends React.Component<IProps, IState> {
|
||||
}
|
||||
} catch (e) {
|
||||
this.setState({ loading: false });
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,14 +85,12 @@ export default class DepositRib extends React.Component<IProps, IState> {
|
||||
// formData.append("file", this.state.documents[0]!, this.state.documents[0]!.name);
|
||||
|
||||
// const sentFile = await Bucket.getInstance().post(formData);
|
||||
// console.log("Sent file:", sentFile);
|
||||
|
||||
// // Reset documents state
|
||||
// this.setState({ documents: [] });
|
||||
// };
|
||||
|
||||
// handleCancel = () => {
|
||||
// console.log("Cancel:", this.state.documents);
|
||||
// // Reset documents state
|
||||
// this.setState({ documents: [] });
|
||||
// };
|
||||
|
@ -29,7 +29,7 @@ export default function Navigation() {
|
||||
await OfficeFolderAnchors.getInstance().getByUid(anchor.folder?.uid as string);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
@ -38,7 +38,6 @@ class ToastElementClass extends React.Component<IPropsClass, IState> {
|
||||
}
|
||||
|
||||
public override render(): JSX.Element {
|
||||
console.log(this.props);
|
||||
const toast = this.props.toast;
|
||||
const style = {
|
||||
"--data-duration": `${toast.time}ms`,
|
||||
|
@ -33,7 +33,6 @@ export default function DocumentTypeListContainer(props: IProps) {
|
||||
const onSelectedBlock = useCallback(
|
||||
(block: IBlock) => {
|
||||
props.onCloseLeftSide && props.onCloseLeftSide();
|
||||
console.log("Block selected :", block);
|
||||
const redirectPath = Module.getInstance().get().modules.pages.DocumentTypes.pages.DocumentTypesInformations.props.path;
|
||||
router.push(redirectPath.replace("[uid]", block.id));
|
||||
},
|
||||
|
@ -36,7 +36,6 @@ export default function DeedTypesCreate(props: IProps) {
|
||||
try {
|
||||
await validateOrReject(deedType, { groups: ["createDeedType"], forbidUnknownValues: true });
|
||||
} catch (validationErrors: Array<ValidationError> | any) {
|
||||
console.log(validationErrors);
|
||||
setValidationError(validationErrors as ValidationError[]);
|
||||
return;
|
||||
}
|
||||
@ -57,12 +56,11 @@ export default function DeedTypesCreate(props: IProps) {
|
||||
.modules.pages.DeedTypes.pages.DeedTypesInformations.props.path.replace("[uid]", deedTypeCreated.uid!),
|
||||
);
|
||||
} catch (validationErrors: Array<ValidationError> | any) {
|
||||
console.log(validationErrors);
|
||||
setValidationError(validationErrors as ValidationError[]);
|
||||
return;
|
||||
}
|
||||
},
|
||||
[router, validationError],
|
||||
[router],
|
||||
);
|
||||
|
||||
const closeConfirmModal = useCallback(() => {
|
||||
|
@ -42,7 +42,6 @@ export default function DocumentTypesEdit() {
|
||||
try {
|
||||
await validateOrReject(documentToUpdate, { groups: ["updateDocumentType"] });
|
||||
} catch (validationErrors: Array<ValidationError> | any) {
|
||||
console.log(validationErrors);
|
||||
if (!Array.isArray(validationErrors)) return;
|
||||
setValidationError(validationErrors as ValidationError[]);
|
||||
return;
|
||||
@ -63,7 +62,7 @@ export default function DocumentTypesEdit() {
|
||||
return;
|
||||
}
|
||||
},
|
||||
[documentTypeUid, router, validationError],
|
||||
[documentTypeUid, router],
|
||||
);
|
||||
|
||||
return (
|
||||
|
@ -242,7 +242,6 @@ class AddClientToFolderClass extends BasePage<IPropsClass, IState> {
|
||||
const contactToCreate = Contact.hydrate<Customer>(values);
|
||||
await contactToCreate.validateOrReject?.({ groups: ["createCustomer"], forbidUnknownValues: false });
|
||||
} catch (validationErrors) {
|
||||
console.log(validationErrors);
|
||||
this.setState({
|
||||
validationError: validationErrors as ValidationError[],
|
||||
});
|
||||
|
@ -200,7 +200,6 @@ class UpdateClientClass extends BasePage<IPropsClass, IState> {
|
||||
try {
|
||||
await contact.validateOrReject?.({ groups: ["createCustomer"], forbidUnknownValues: false });
|
||||
} catch (validationErrors) {
|
||||
console.log(validationErrors);
|
||||
this.setState({
|
||||
validationError: validationErrors as ValidationError[],
|
||||
});
|
||||
|
@ -200,7 +200,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
fileBlob,
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@ export default function LoginCallBack() {
|
||||
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
||||
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||
} catch (e: any) {
|
||||
console.log("Log error : ", e);
|
||||
if (e.http_status === 401 && e.message === "Email not found") {
|
||||
return router.push(Module.getInstance().get().modules.pages.Login.props.path + "?error=3");
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export default function LoginCallBackCustomer() {
|
||||
try {
|
||||
token = await Customers.getInstance().loginCallback(tokenid360);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
router.push(Module.getInstance().get().modules.pages.CustomersLogin.props.path + "?error=1");
|
||||
return;
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ export default function RolesCreate(props: IProps) {
|
||||
try {
|
||||
await officeRole.validateOrReject?.({ groups: ["createOfficeRole"], forbidUnknownValues: true });
|
||||
} catch (validationErrors: Array<ValidationError> | any) {
|
||||
console.log(validationErrors);
|
||||
if (!Array.isArray(validationErrors)) return;
|
||||
setValidationError(validationErrors as ValidationError[]);
|
||||
return;
|
||||
@ -52,13 +51,12 @@ export default function RolesCreate(props: IProps) {
|
||||
|
||||
router.push(Module.getInstance().get().modules.pages.Roles.pages.RolesInformations.props.path.replace("[uid]", role.uid!));
|
||||
} catch (validationErrors: Array<ValidationError> | any) {
|
||||
console.log(validationErrors);
|
||||
if (!Array.isArray(validationErrors)) return;
|
||||
setValidationError(validationErrors as ValidationError[]);
|
||||
return;
|
||||
}
|
||||
},
|
||||
[router, validationError],
|
||||
[router],
|
||||
);
|
||||
|
||||
const closeConfirmModal = useCallback(() => {
|
||||
@ -96,7 +94,11 @@ export default function RolesCreate(props: IProps) {
|
||||
<Typography typo={ITypo.H1Bis}>Créer un rôle</Typography>
|
||||
</div>
|
||||
<Form onSubmit={onSubmitHandler} className={classes["form-container"]} onFieldChange={onFieldChange}>
|
||||
<TextField name="name" placeholder="Nom du rôle" validationError={validationError.find((error) => error.property === "name")}/>
|
||||
<TextField
|
||||
name="name"
|
||||
placeholder="Nom du rôle"
|
||||
validationError={validationError.find((error) => error.property === "name")}
|
||||
/>
|
||||
<div className={classes["buttons-container"]}>
|
||||
<Button variant={EButtonVariant.GHOST} onClick={onCancel}>
|
||||
Annuler
|
||||
|
@ -18,7 +18,6 @@ export default function SelectFolder() {
|
||||
async function getFolders() {
|
||||
const jwt = JwtService.getInstance().decodeCustomerJwt();
|
||||
if (!jwt) return;
|
||||
console.log(jwt)
|
||||
|
||||
const folders = await Folders.getInstance().get({
|
||||
q: {
|
||||
@ -37,8 +36,8 @@ export default function SelectFolder() {
|
||||
},
|
||||
],
|
||||
include: {
|
||||
customers: true
|
||||
}
|
||||
customers: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
setFolders(folders);
|
||||
|
@ -75,7 +75,6 @@ export default function SubscriptionManageCollaborators() {
|
||||
const loadSubscription = useCallback(async () => {
|
||||
const jwt = JwtService.getInstance().decodeJwt();
|
||||
const subscription = await Subscriptions.getInstance().get({ where: { office: { uid: jwt?.office_Id } } });
|
||||
console.log(subscription);
|
||||
if (!subscription[0]) return;
|
||||
subscription[0].seats?.forEach((seat) => setSelectedCollaborators((prev) => [...prev, seat.user.uid!]));
|
||||
setSubscription(subscription[0]);
|
||||
|
@ -17,7 +17,6 @@ export default function SubscriptionError() {
|
||||
const loadSubscription = useCallback(async () => {
|
||||
const jwt = JwtService.getInstance().decodeJwt();
|
||||
const subscription = await Subscriptions.getInstance().get({ where: { office: { uid: jwt?.office_Id } } });
|
||||
console.log(subscription);
|
||||
if (!subscription[0]) return;
|
||||
setSubscription(subscription[0]);
|
||||
}, []);
|
||||
|
@ -44,7 +44,6 @@ export default function SubscriptionFacturation() {
|
||||
const loadSubscription = useCallback(async () => {
|
||||
const jwt = JwtService.getInstance().decodeJwt();
|
||||
const subscription = await Subscriptions.getInstance().get({ where: { office: { uid: jwt?.office_Id } } });
|
||||
console.log(subscription);
|
||||
if (!subscription[0]) {
|
||||
router.push(Module.getInstance().get().modules.pages.Subscription.pages.New.props.path);
|
||||
} else {
|
||||
|
@ -19,7 +19,6 @@ export default function SubscriptionSuccess() {
|
||||
const loadSubscription = useCallback(async () => {
|
||||
const jwt = JwtService.getInstance().decodeJwt();
|
||||
const subscription = await Subscriptions.getInstance().get({ where: { office: { uid: jwt?.office_Id } } });
|
||||
console.log(subscription);
|
||||
if (!subscription[0]) return;
|
||||
setSubscription(subscription[0]);
|
||||
}, []);
|
||||
|
@ -47,7 +47,6 @@ export default class JwtService {
|
||||
return jwt_decode(accessToken);
|
||||
}
|
||||
|
||||
|
||||
public decodeJwt(): IUserJwtPayload | undefined {
|
||||
const accessToken = CookieService.getInstance().getCookie("leCoffreAccessToken");
|
||||
if (!accessToken) return;
|
||||
@ -78,7 +77,7 @@ export default class JwtService {
|
||||
`${
|
||||
variables.BACK_API_PROTOCOL + variables.BACK_API_HOST + variables.BACK_API_ROOT_URL + variables.BACK_API_VERSION
|
||||
}/idnot/user/auth/refresh-token`,
|
||||
{ method: 'POST', headers: headers },
|
||||
{ method: "POST", headers: headers },
|
||||
);
|
||||
const newAccessToken: { accessToken: string } = await response.json();
|
||||
if (newAccessToken) {
|
||||
@ -86,7 +85,7 @@ export default class JwtService {
|
||||
return true;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.error(err);
|
||||
return false;
|
||||
}
|
||||
} else if (customerToken?.customerId) {
|
||||
@ -97,7 +96,7 @@ export default class JwtService {
|
||||
`${
|
||||
variables.BACK_API_PROTOCOL + variables.BACK_API_HOST + variables.BACK_API_ROOT_URL + variables.BACK_API_VERSION
|
||||
}/id360/customers/refresh-token`,
|
||||
{ method: 'POST', headers: headers },
|
||||
{ method: "POST", headers: headers },
|
||||
);
|
||||
const newAccessToken: { accessToken: string } = await response.json();
|
||||
if (newAccessToken) {
|
||||
@ -105,7 +104,7 @@ export default class JwtService {
|
||||
return true;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.error(err);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user