Fix update current client
This commit is contained in:
@@ -14,19 +14,19 @@ export function buildCurrentUserResolver(cache: ApolloCache<NormalizedCacheObjec
|
||||
});
|
||||
|
||||
return {
|
||||
updateCurrentUser: (_, { id, email, isLoggedIn }, { cache }) => {
|
||||
const data = {
|
||||
Mutation: {
|
||||
Mutation: {
|
||||
updateCurrentUser: (_, { id, email, isLoggedIn }, { cache }) => {
|
||||
const data = {
|
||||
currentUser: {
|
||||
id,
|
||||
email,
|
||||
isLoggedIn,
|
||||
__typename: 'CurrentUser',
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
cache.writeData({ data });
|
||||
cache.writeData({ data });
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ mutation Login($email: String!, $password: String!) {
|
||||
refreshToken,
|
||||
user {
|
||||
id,
|
||||
email
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -21,7 +22,8 @@ mutation SendResetPassword($email: String!) {
|
||||
export const RESET_PASSWORD = gql`
|
||||
mutation ResetPassword($token: String!, $password: String!) {
|
||||
resetPassword(token: $token, password: $password) {
|
||||
token,
|
||||
accessToken,
|
||||
refreshToken
|
||||
user {
|
||||
id,
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ export default class EditIdentity extends Vue {
|
||||
}
|
||||
|
||||
openDeleteIdentityConfirmation() {
|
||||
this.$dialog.prompt({
|
||||
this.$buefy.dialog.prompt({
|
||||
type: 'is-danger',
|
||||
title: this.$gettext('Delete your identity'),
|
||||
message: this.$gettextInterpolate(
|
||||
|
||||
@@ -146,9 +146,9 @@ export default class Login extends Vue {
|
||||
onLogin(this.$apollo);
|
||||
|
||||
if (this.redirect) {
|
||||
this.$router.push(this.redirect);
|
||||
await this.$router.push(this.redirect);
|
||||
} else {
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
await this.$router.push({ name: RouteName.HOME });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
@@ -107,9 +107,7 @@ const apolloClient = new ApolloClient({
|
||||
cache,
|
||||
link,
|
||||
connectToDevTools: true,
|
||||
resolvers: {
|
||||
currentUser: buildCurrentUserResolver(cache),
|
||||
},
|
||||
resolvers: buildCurrentUserResolver(cache)
|
||||
});
|
||||
|
||||
export const apolloProvider = new VueApollo({
|
||||
|
||||
Reference in New Issue
Block a user