Skip to content

Commit 6b3409d

Browse files
authored
Merge pull request #2615 from appwrite/fix-organization-billing
2 parents 2f91d97 + 2ed1d8c commit 6b3409d

9 files changed

Lines changed: 49 additions & 54 deletions

File tree

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
name: Dockerize Profiles
22

33
on:
4-
push:
5-
branches: [feat-profiles]
6-
pull_request:
7-
types: [opened, synchronize, reopened]
8-
branches: [feat-profiles]
9-
workflow_dispatch:
4+
push:
5+
branches: [feat-profiles]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
branches: [feat-profiles]
9+
workflow_dispatch:
1010

1111
jobs:
12-
dockerize-profiles:
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- name: Checkout the repo
17-
uses: actions/checkout@v2
18-
- name: Set up QEMU
19-
uses: docker/setup-qemu-action@v2
20-
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v2
22-
- name: Log in to Docker Hub
23-
uses: docker/login-action@v3
24-
with:
25-
username: ${{ vars.DOCKERHUB_USERNAME }}
26-
password: ${{ secrets.DOCKERHUB_TOKEN }}
12+
dockerize-profiles:
13+
runs-on: ubuntu-latest
2714

28-
- name: Extract metadata (tags, labels) for Docker
29-
id: meta
30-
uses: docker/metadata-action@v5
31-
with:
32-
images: appwrite/console-profiles
33-
tags: |
34-
type=ref,event=branch,prefix=branch-
35-
type=ref,event=pr
36-
type=sha,prefix=sha-
37-
type=raw,value=gh-${{ github.run_id}}
38-
flavor: |
39-
latest=false
15+
steps:
16+
- name: Checkout the repo
17+
uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v2
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ vars.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
4027

41-
- name: Build and push Docker image
42-
id: push
43-
uses: docker/build-push-action@v6
44-
with:
45-
context: .
46-
push: true
47-
platforms: linux/amd64,linux/arm64
48-
tags: ${{ steps.meta.outputs.tags }}
49-
labels: ${{ steps.meta.outputs.labels }}
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: appwrite/console-profiles
33+
tags: |
34+
type=ref,event=branch,prefix=branch-
35+
type=ref,event=pr
36+
type=sha,prefix=sha-
37+
type=raw,value=gh-${{ github.run_id}}
38+
flavor: |
39+
latest=false
40+
41+
- name: Build and push Docker image
42+
id: push
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: .
46+
push: true
47+
platforms: linux/amd64,linux/arm64
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}

src/lib/sdk/billing.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export class Billing {
490490
name: string,
491491
billingPlan: string,
492492
paymentMethodId: string,
493-
billingAddressId: string = null,
493+
billingAddressId: string = undefined,
494494
couponId: string = null,
495495
invites: Array<string> = [],
496496
budget: number = undefined,
@@ -628,6 +628,7 @@ export class Billing {
628628
budget,
629629
taxId
630630
};
631+
631632
const uri = new URL(this.client.config.endpoint + path);
632633
return await this.client.call(
633634
'patch',

src/routes/(console)/apply-credit/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
name,
135135
billingPlan,
136136
paymentMethodId,
137-
null,
137+
undefined,
138138
couponData.code ? couponData.code : null,
139139
collaborators,
140140
billingBudget,
@@ -148,7 +148,7 @@
148148
selectedOrg.$id,
149149
billingPlan,
150150
paymentMethodId,
151-
null,
151+
undefined,
152152
couponData.code ? couponData.code : null,
153153
collaborators
154154
);

src/routes/(console)/create-organization/+page.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
ID.unique(),
113113
name,
114114
BillingPlan.FREE,
115-
null,
116115
null
117116
);
118117
} else {
@@ -121,7 +120,7 @@
121120
name,
122121
selectedPlan,
123122
paymentMethodId,
124-
null,
123+
undefined,
125124
selectedCoupon?.code,
126125
collaborators,
127126
billingBudget,

src/routes/(console)/onboarding/create-organization/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
ID.unique(),
2626
organizationName,
2727
BillingPlan.FREE,
28-
null,
2928
null
3029
);
3130

src/routes/(console)/onboarding/create-project/+page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const load: PageLoad = async ({ parent }) => {
2929
ID.unique(),
3030
'Personal projects',
3131
BillingPlan.FREE,
32-
null,
3332
null
3433
);
3534
trackEvent(Submit.OrganizationCreate, {

src/routes/(console)/organization-[organization]/change-plan/+page.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@
173173
await sdk.forConsole.billing.updatePlan(
174174
data.organization.$id,
175175
selectedPlan,
176-
paymentMethodId,
177-
null
176+
paymentMethodId
178177
);
179178
180179
// 2) If the target plan has a project limit, apply selected projects now
@@ -254,7 +253,7 @@
254253
data.organization.$id,
255254
selectedPlan,
256255
paymentMethodId,
257-
null,
256+
undefined,
258257
selectedCoupon?.code,
259258
newCollaborators,
260259
billingBudget,

src/routes/(public)/functions/deploy/+page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export const load: PageLoad = async ({ parent, url }) => {
7878
ID.unique(),
7979
'Personal Projects',
8080
BillingPlan.FREE,
81-
null,
8281
null
8382
);
8483
} else {

src/routes/(public)/template-[template]/+page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const load = async ({ parent, url, params }) => {
4949
ID.unique(),
5050
'Personal project',
5151
BillingPlan.FREE,
52-
null,
5352
null
5453
);
5554
}

0 commit comments

Comments
 (0)