forked from github/plane
fix: cloud fixes
This commit is contained in:
parent
912851659c
commit
1a0f912ab4
@ -23,16 +23,16 @@ export const UpgradeWorkspaceModal: FC<IUpgradeWorkspaceModal> = observer((props
|
||||
// fetching products
|
||||
const { data: products } = useSWR("UPGRADE_PRODUCTS", () => licenseService.getProducts());
|
||||
|
||||
console.log("products", products);
|
||||
|
||||
const handleUpgrade = (product: any) => {
|
||||
if (currentUser && workspaceMembers && workspaceMembers?.length >= 1 && currentWorkspace) {
|
||||
// licenseService.createSubscription(currentUser, product?.default_price?.id).then((response) => {
|
||||
// console.log("subscription", response);
|
||||
// });
|
||||
|
||||
licenseService
|
||||
.createCheckoutSession(product?.default_price?.id, workspaceMembers?.length, currentWorkspace, currentUser)
|
||||
.createCheckoutSession(
|
||||
product?.default_price?.id,
|
||||
workspaceMembers?.length,
|
||||
currentWorkspace,
|
||||
currentUser,
|
||||
product?.metadata
|
||||
)
|
||||
.then((response) => {
|
||||
console.log("subscription", response);
|
||||
window.open(response.url, "_blank");
|
||||
|
@ -23,8 +23,14 @@ export class LicenseService extends APIService {
|
||||
});
|
||||
}
|
||||
|
||||
async createCheckoutSession(priceId: string, seats: number, workspace: IWorkspace, user: IUser): Promise<any> {
|
||||
return this.post(`/api/checkout/create-session/`, { priceId, seats, workspace, user })
|
||||
async createCheckoutSession(
|
||||
priceId: string,
|
||||
seats: number,
|
||||
workspace: IWorkspace,
|
||||
user: IUser,
|
||||
metadata: any
|
||||
): Promise<any> {
|
||||
return this.post(`/api/checkout/create-session/`, { priceId, seats, workspace, user, metadata })
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
|
Loading…
Reference in New Issue
Block a user