Fix typescript issues and bump deps
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -124,20 +124,23 @@ export default class Login extends Vue {
|
||||
this.errors = [];
|
||||
|
||||
try {
|
||||
const result = await this.$apollo.mutate<{ login: ILogin }>({
|
||||
const { data } = await this.$apollo.mutate<{ login: ILogin }>({
|
||||
mutation: LOGIN,
|
||||
variables: {
|
||||
email: this.credentials.email,
|
||||
password: this.credentials.password,
|
||||
},
|
||||
});
|
||||
if (data == null) {
|
||||
throw new Error('Data is undefined');
|
||||
}
|
||||
|
||||
saveUserData(result.data.login);
|
||||
saveUserData(data.login);
|
||||
|
||||
await this.$apollo.mutate({
|
||||
mutation: UPDATE_CURRENT_USER_CLIENT,
|
||||
variables: {
|
||||
id: result.data.login.user.id,
|
||||
id: data.login.user.id,
|
||||
email: this.credentials.email,
|
||||
isLoggedIn: true,
|
||||
},
|
||||
|
||||
@@ -71,16 +71,19 @@ export default class PasswordReset extends Vue {
|
||||
this.errors.splice(0);
|
||||
|
||||
try {
|
||||
const result = await this.$apollo.mutate<{ resetPassword: ILogin }>({
|
||||
const { data } = await this.$apollo.mutate<{ resetPassword: ILogin }>({
|
||||
mutation: RESET_PASSWORD,
|
||||
variables: {
|
||||
password: this.credentials.password,
|
||||
token: this.token,
|
||||
},
|
||||
});
|
||||
if (data == null) {
|
||||
throw new Error('Data is undefined');
|
||||
}
|
||||
|
||||
saveUserData(result.data.resetPassword);
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
saveUserData(data.resetPassword);
|
||||
await this.$router.push({ name: RouteName.HOME });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
err.graphQLErrors.forEach(({ message }) => {
|
||||
|
||||
Reference in New Issue
Block a user