refacto votes and connexion
This commit is contained in:
parent
9c14c1df3b
commit
f06539bb78
@ -24,7 +24,7 @@
|
||||
"eslint-config-next": "13.2.4",
|
||||
"form-data": "^4.0.0",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.89",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.90",
|
||||
"next": "13.2.4",
|
||||
"prettier": "^2.8.7",
|
||||
"react": "18.2.0",
|
||||
|
@ -27,7 +27,6 @@ export default class User extends BaseApiService {
|
||||
}
|
||||
|
||||
public async verifyJwt(jwt: string) {
|
||||
console.log(this.baseURl);
|
||||
const url = new URL(`${this.baseURl}/verify-token/${jwt}`);
|
||||
try {
|
||||
return await this.postRequest(url);
|
||||
|
@ -16,7 +16,6 @@ export default class Auth extends BaseApiService {
|
||||
public async logOutWithIdNot() {
|
||||
const variables = FrontendVariables.getInstance();
|
||||
const url = new URL(`${variables.IDNOT_BASE_URL}/user/auth/logout?post_logout_redirect_uri=${variables.FRONT_APP_HOST}`);
|
||||
console.log(url.toString())
|
||||
try {
|
||||
return await fetch(url);
|
||||
} catch (err) {
|
||||
|
@ -121,7 +121,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
||||
{this.state.currentFiles && this.state.currentFiles.length > 0 && (
|
||||
<div className={classes["documents-container"]}>
|
||||
{this.state.currentFiles.map((file) => {
|
||||
console.log(file);
|
||||
|
||||
const fileObj = file.file;
|
||||
|
||||
@ -237,9 +236,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
||||
this.setState({
|
||||
currentFiles: tmpArray,
|
||||
});
|
||||
|
||||
console.log(this.state.currentFiles);
|
||||
|
||||
// const formData = new FormData();
|
||||
// formData.append("file", file, file.name);
|
||||
// const query = JSON.stringify({ document: { uid: this.props.document.uid } });
|
||||
@ -272,7 +268,6 @@ export default class DepositOtherDocument extends React.Component<IProps, IState
|
||||
private async removeFile(e: any) {
|
||||
const image = e.target as HTMLElement;
|
||||
const indexToRemove = image.getAttribute("data-file");
|
||||
console.log(indexToRemove);
|
||||
|
||||
if (!indexToRemove) return;
|
||||
const file = this.state.currentFiles!.find((file) => file.index === parseInt(indexToRemove));
|
||||
|
@ -22,6 +22,7 @@ export default function LoginCallBack() {
|
||||
if (!code) return;
|
||||
try {
|
||||
const token = await Auth.getInstance().getIdnotJwt(code as string);
|
||||
if (!token) return router.push(Module.getInstance().get().modules.pages.Login.props.path);
|
||||
await UserStore.instance.connect(token.accessToken, token.refreshToken);
|
||||
return router.push(Module.getInstance().get().modules.pages.Folder.props.path);
|
||||
} catch (e) {
|
||||
|
@ -165,7 +165,7 @@ export default function UserInformations(props: IProps) {
|
||||
let vote = Vote.hydrate<Vote>({
|
||||
appointment: Appointment.hydrate<Appointment>({
|
||||
uid: currentAppointment?.uid ?? undefined,
|
||||
targeted_user: User.hydrate<User>({
|
||||
user: User.hydrate<User>({
|
||||
uid: userSelected.uid,
|
||||
}),
|
||||
choice: superAdminModalType === "add" ? EVote.NOMINATE : EVote.DISMISS,
|
||||
|
Loading…
x
Reference in New Issue
Block a user