Commit 2bf761d4 authored by Nikolai R Kristiansen's avatar Nikolai R Kristiansen

Refetech user data if memberships has expired

parent 9863ec99
Pipeline #709 failed with stage
in 1 minute and 55 seconds
......@@ -21,6 +21,10 @@ class ProofContainer extends Component {
return membershipTypes[0].price / 100;
}
componentDidMount = () => {
this.checkExpiry();
};
render() {
return (
<Proof
......@@ -37,6 +41,15 @@ class ProofContainer extends Component {
);
}
checkExpiry() {
const { user, fetchUser } = this.props;
const todaysDate = new Date().toISOString().substring(0, 10);
const lastMembership = user.last_membership;
if (lastMembership && lastMembership.membership_type !== 'lifelong' && lastMembership.end_date > todaysDate) {
fetchUser();
}
}
openStripe = () => {
const options = {
prefilledInformation: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment