mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(server): allow to checkout selfhost team in canary (#10130)
This commit is contained in:
@@ -29,6 +29,13 @@ import {
|
||||
|
||||
export const SelfhostTeamCheckoutArgs = z.object({
|
||||
quantity: z.number(),
|
||||
user: z
|
||||
.object({
|
||||
id: z.string(),
|
||||
email: z.string(),
|
||||
})
|
||||
.optional()
|
||||
.nullable(),
|
||||
});
|
||||
|
||||
export const SelfhostTeamSubscriptionIdentity = z.object({
|
||||
|
||||
@@ -279,6 +279,7 @@ export class SubscriptionResolver {
|
||||
session = await this.service.checkout(input, {
|
||||
plan: input.plan as any,
|
||||
quantity: input.args?.quantity ?? 10,
|
||||
user,
|
||||
});
|
||||
} else {
|
||||
if (!user) {
|
||||
|
||||
@@ -134,7 +134,8 @@ export class SubscriptionService implements OnApplicationBootstrap {
|
||||
if (
|
||||
this.config.deploy &&
|
||||
this.config.affine.canary &&
|
||||
(!('user' in args) || !this.feature.isStaff(args.user.email))
|
||||
args.user &&
|
||||
!this.feature.isStaff(args.user.email)
|
||||
) {
|
||||
throw new ActionForbidden();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user