mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-12 07:30:46 +02:00
Merge pull request #29193 from overleaf/rh-stripe-addon-error
Redirect to plans page if trying to add add-on to non-existing subscription GitOrigin-RevId: 65e0a88c32beca00d700292b14b2e7aa6e4dad20
This commit is contained in:
@@ -523,6 +523,12 @@ async function previewAddonPurchase(req, res) {
|
||||
'/user/subscription?redirect-reason=ai-assist-unavailable'
|
||||
)
|
||||
}
|
||||
if (
|
||||
err instanceof Error &&
|
||||
err.constructor.name === 'PaymentServiceResourceNotFoundError'
|
||||
) {
|
||||
return res.redirect('/user/subscription/plans#ai-assist')
|
||||
}
|
||||
throw err
|
||||
}
|
||||
|
||||
@@ -543,6 +549,12 @@ async function previewAddonPurchase(req, res) {
|
||||
if (err instanceof DuplicateAddOnError) {
|
||||
return res.redirect('/user/subscription?redirect-reason=double-buy')
|
||||
}
|
||||
if (
|
||||
err instanceof Error &&
|
||||
err.constructor.name === 'PaymentServiceResourceNotFoundError'
|
||||
) {
|
||||
return res.redirect('/user/subscription/plans#ai-assist')
|
||||
}
|
||||
throw err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user