mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-24 22:55:50 +00:00
Reloaded user data after cancelling subscription (#9836)
This commit is contained in:
parent
be1ffbd671
commit
f5d7777b2c
1 changed files with 10 additions and 6 deletions
|
|
@ -203,14 +203,18 @@ export default {
|
|||
queryParams.groupId = group._id;
|
||||
}
|
||||
|
||||
let cancelUrl = `/${paymentMethod}/subscribe/cancel?${encodeParams(queryParams)}`;
|
||||
await axios.get(cancelUrl);
|
||||
try {
|
||||
const cancelUrl = `/${paymentMethod}/subscribe/cancel?${encodeParams(queryParams)}`;
|
||||
await axios.get(cancelUrl);
|
||||
|
||||
this.loading = false;
|
||||
alert(this.$t('paypalCanceled'));
|
||||
// @TODO: We should probably update the api to return the new sub data eventually.
|
||||
await this.$store.dispatch('user:fetch', {forceLoad: true});
|
||||
|
||||
// Success
|
||||
alert(this.$t('paypalCanceled'));
|
||||
this.$router.push('/');
|
||||
this.loading = false;
|
||||
} catch (e) {
|
||||
alert(e.response.data.message);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue