mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-08 07:05:08 +02:00
Add ? to support undefined
This commit is contained in:
@@ -17,6 +17,7 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
import { Tier } from "@server/types/Tiers";
|
import { Tier } from "@server/types/Tiers";
|
||||||
|
import logger from "@server/logger";
|
||||||
|
|
||||||
export function verifyValidSubscription(tiers: Tier[]) {
|
export function verifyValidSubscription(tiers: Tier[]) {
|
||||||
return async function (
|
return async function (
|
||||||
@@ -30,9 +31,9 @@ export function verifyValidSubscription(tiers: Tier[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const orgId =
|
const orgId =
|
||||||
req.params.orgId ||
|
req.params?.orgId ||
|
||||||
req.body.orgId ||
|
req.body?.orgId ||
|
||||||
req.query.orgId ||
|
req.query?.orgId ||
|
||||||
req.userOrgId;
|
req.userOrgId;
|
||||||
|
|
||||||
if (!orgId) {
|
if (!orgId) {
|
||||||
@@ -65,7 +66,7 @@ export function verifyValidSubscription(tiers: Tier[]) {
|
|||||||
|
|
||||||
return next();
|
return next();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
logger.error(e);
|
||||||
return next(
|
return next(
|
||||||
createHttpError(
|
createHttpError(
|
||||||
HttpCode.INTERNAL_SERVER_ERROR,
|
HttpCode.INTERNAL_SERVER_ERROR,
|
||||||
|
|||||||
Reference in New Issue
Block a user