fix(server): wrong affine pro endpoint (#10144)

This commit is contained in:
forehalo
2025-02-13 07:41:08 +00:00
parent 31ca8f25b6
commit 3f97203623
2 changed files with 12 additions and 13 deletions

View File

@@ -330,18 +330,17 @@ export class LicenseService implements OnModuleInit {
path: string, path: string,
init?: RequestInit init?: RequestInit
): Promise<T & { res: Response }> { ): Promise<T & { res: Response }> {
const endpoint =
process.env.AFFINE_PRO_SERVER_ENDPOINT ?? 'https://app.affine.pro';
try { try {
const res = await fetch( const res = await fetch(endpoint + path, {
process.env.AFFINE_PRO_SERVER_ENDPOINT ?? ...init,
'https://app.affine.pro' + path, headers: {
{ 'Content-Type': 'application/json',
...init, ...init?.headers,
headers: { },
'Content-Type': 'application/json', });
...init?.headers,
},
}
);
if (!res.ok) { if (!res.ok) {
const body = (await res.json()) as UserFriendlyError; const body = (await res.json()) as UserFriendlyError;

View File

@@ -215,7 +215,7 @@ export const DEFAULT_PRICES = new Map([
// team // team
[ [
`${SubscriptionPlan.Team}_${SubscriptionRecurring.Monthly}`, `${SubscriptionPlan.Team}_${SubscriptionRecurring.Monthly}`,
{ product: 'AFFiNE Team(per seat)', price: 1440 }, { product: 'AFFiNE Team(per seat)', price: 1200 },
], ],
[ [
`${SubscriptionPlan.Team}_${SubscriptionRecurring.Yearly}`, `${SubscriptionPlan.Team}_${SubscriptionRecurring.Yearly}`,
@@ -225,7 +225,7 @@ export const DEFAULT_PRICES = new Map([
// selfhost team // selfhost team
[ [
`${SubscriptionPlan.SelfHostedTeam}_${SubscriptionRecurring.Monthly}`, `${SubscriptionPlan.SelfHostedTeam}_${SubscriptionRecurring.Monthly}`,
{ product: 'AFFiNE Self-hosted Team(per seat)', price: 1440 }, { product: 'AFFiNE Self-hosted Team(per seat)', price: 1200 },
], ],
[ [
`${SubscriptionPlan.SelfHostedTeam}_${SubscriptionRecurring.Yearly}`, `${SubscriptionPlan.SelfHostedTeam}_${SubscriptionRecurring.Yearly}`,