fix(server): wrong affine pro endpoint (#10144)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user