#784 - Redirect to Project Page if User Already Has a Subscription - #794
Conversation
e8d0e9c to
947076e
Compare
|
@alexwilkinson maybe we want to put all this into a service object and take an approach similar to some of the other services there (like the user skills one). |
|
@joshsmith Definitely fond of that idea—I was thinking of doing that from the start, once the logic had been figured out. |
|
@alexwilkinson I'm sorry not to have realised this sooner, but I was actually working on the same solution. We seem to have duplicate issues, #784 and #798, one of which was assigned to you and another to myself. I'm dealing with mine in #803 Mine is just about ready to merge and contains other fixes, but it only deals with redirection from the Once it's merged, I was thinking we should revisit your issue (since based on title alone, it's wider in scope) and figure out if anything else is needed in relation to a user already having a subscription. I apologize for the inconvenience. It was an honest mistake on my part, since you clearly started on your issue sooner. We'll work on avoiding these sort of misunderstandings in the future. |
|
@begedin That's ok!! You got much further along anyways, and if my little work on this Issue just ended up helping me get acclimated to the project, that's useful too : ). I'll just note on your PR another mirage model that you can fix while you're at it—something @joshsmith discovered while we were discussing my mirage struggles. The only thing that could be revisited around this Issue would be potentially showing a more useful page to the user in the situation where they already have a subscription, instead of just redirecting. That conversation is in #784. I'm going to make a new Issue about that. |
|
@alexwilkinson not sure if you made a new issue, but please do when you get a chance! |
This is still a work in progress, but the idea is to put in a check in the
afterModelhook of thedonateroute for whether the current user has a stripe subscription for a project already. If so, redirect to the project page.So far, the
user.stripeConnectSubscriptionscollection seems to be available, but I am having trouble traversing the object graph when inspecting an individual subscription in the find loop. Maybe mirage isn't setting up the obejcts properly?Also updated errors in the mirage models.
Will Fix #784