2
0

🐛 (billing) Upgrade again after cancelling

This commit is contained in:
Baptiste Arnaud
2022-10-31 19:08:04 +01:00
parent 385853ca3c
commit d132cb118a
4 changed files with 27 additions and 7 deletions

View File

@ -35,7 +35,14 @@ export const updatePlan = async ({
const { data, error } = await sendRequest<{ message: string }>({
method: 'PUT',
url: '/api/stripe/subscription',
body: { workspaceId, plan, stripeId, additionalChats, additionalStorage },
body: {
workspaceId,
plan,
stripeId,
additionalChats,
additionalStorage,
currency: guessIfUserIsEuropean() ? 'eur' : 'usd',
},
})
if (error || !data) return { error }
return { newPlan: plan }