mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Reloaded user data after cancelling subscription (#9836)
This commit is contained in:
@@ -203,14 +203,18 @@ export default {
|
|||||||
queryParams.groupId = group._id;
|
queryParams.groupId = group._id;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cancelUrl = `/${paymentMethod}/subscribe/cancel?${encodeParams(queryParams)}`;
|
try {
|
||||||
await axios.get(cancelUrl);
|
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
|
this.loading = false;
|
||||||
alert(this.$t('paypalCanceled'));
|
} catch (e) {
|
||||||
this.$router.push('/');
|
alert(e.response.data.message);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user