Add ? to support undefined

This commit is contained in:
Owen
2026-07-07 10:59:01 -04:00
parent e9d424eb80
commit 83de8576bf
@@ -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,