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
@@ -330,18 +330,17 @@ export class LicenseService implements OnModuleInit {
path: string,
init?: RequestInit
): Promise<T & { res: Response }> {
const endpoint =
process.env.AFFINE_PRO_SERVER_ENDPOINT ?? 'https://app.affine.pro';
try {
const res = await fetch(
process.env.AFFINE_PRO_SERVER_ENDPOINT ??
'https://app.affine.pro' + path,
{
...init,
headers: {
'Content-Type': 'application/json',
...init?.headers,
},
}
);
const res = await fetch(endpoint + path, {
...init,
headers: {
'Content-Type': 'application/json',
...init?.headers,
},
});
if (!res.ok) {
const body = (await res.json()) as UserFriendlyError;
@@ -215,7 +215,7 @@ export const DEFAULT_PRICES = new Map([
// team
[
`${SubscriptionPlan.Team}_${SubscriptionRecurring.Monthly}`,
{ product: 'AFFiNE Team(per seat)', price: 1440 },
{ product: 'AFFiNE Team(per seat)', price: 1200 },
],
[
`${SubscriptionPlan.Team}_${SubscriptionRecurring.Yearly}`,
@@ -225,7 +225,7 @@ export const DEFAULT_PRICES = new Map([
// selfhost team
[
`${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}`,