mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-09 17:18:31 +00:00
Add ? to support undefined
This commit is contained in:
parent
e9d424eb80
commit
83de8576bf
1 changed files with 5 additions and 4 deletions
|
|
@ -17,6 +17,7 @@ import HttpCode from "@server/types/HttpCode";
|
|||
import { build } from "@server/build";
|
||||
import { getOrgTierData } from "#private/lib/billing";
|
||||
import { Tier } from "@server/types/Tiers";
|
||||
import logger from "@server/logger";
|
||||
|
||||
export function verifyValidSubscription(tiers: Tier[]) {
|
||||
return async function (
|
||||
|
|
@ -30,9 +31,9 @@ export function verifyValidSubscription(tiers: Tier[]) {
|
|||
}
|
||||
|
||||
const orgId =
|
||||
req.params.orgId ||
|
||||
req.body.orgId ||
|
||||
req.query.orgId ||
|
||||
req.params?.orgId ||
|
||||
req.body?.orgId ||
|
||||
req.query?.orgId ||
|
||||
req.userOrgId;
|
||||
|
||||
if (!orgId) {
|
||||
|
|
@ -65,7 +66,7 @@ export function verifyValidSubscription(tiers: Tier[]) {
|
|||
|
||||
return next();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.INTERNAL_SERVER_ERROR,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue