Function return type is illegal, not sure how this passed eslint (#21567) (#21622)

Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
Hariom Balhara
2025-05-30 13:18:04 +05:30
committed by GitHub
co-authored by Alex van Andel
parent b91607b5b4
commit 8753a6e4d6
5 changed files with 11 additions and 2 deletions
+1
View File
@@ -27,6 +27,7 @@ vi.mock("@calcom/lib/constants", () => ({
IS_PRODUCTION: true,
WEBAPP_URL: "http://localhost:3000",
RESERVED_SUBDOMAINS: ["auth", "docs"],
SINGLE_ORG_SLUG: "",
}));
describe("getSchedule", () => {
@@ -66,6 +66,7 @@ vi.mock("@calcom/lib/constants", () => ({
WEBAPP_URL: "http://localhost:3000",
RESERVED_SUBDOMAINS: ["auth", "docs"],
ROLLING_WINDOW_PERIOD_MAX_DAYS_TO_CHECK: 61,
SINGLE_ORG_SLUG: "",
}));
describe("getSchedule", () => {
@@ -1,7 +1,7 @@
import type { Prisma } from "@prisma/client";
import type { IncomingMessage } from "http";
import { IS_PRODUCTION, WEBSITE_URL } from "@calcom/lib/constants";
import { IS_PRODUCTION, WEBSITE_URL, SINGLE_ORG_SLUG } from "@calcom/lib/constants";
import { ALLOWED_HOSTNAMES, RESERVED_SUBDOMAINS, WEBAPP_URL } from "@calcom/lib/constants";
import logger from "@calcom/lib/logger";
import slugify from "@calcom/lib/slugify";
@@ -26,6 +26,12 @@ export function getOrgSlug(hostname: string, forcedSlug?: string) {
});
}
// If SINGLE_ORG_SLUG is set we know that the Cal.com instance is configured to run just one organization, so we can return the slug directly.
if (SINGLE_ORG_SLUG) {
log.debug("In Single Org Mode, using SINGLE_ORG_SLUG as the Org slug", { SINGLE_ORG_SLUG });
return SINGLE_ORG_SLUG;
}
if (!hostname.includes(".")) {
log.warn('Org support not enabled for hostname without "."', { hostname });
// A no-dot domain can never be org domain. It automatically considers localhost to be non-org domain
+1
View File
@@ -20,6 +20,7 @@ const initialConstants = {
APP_NAME: "Cal.com",
BOOKER_NUMBER_OF_DAYS_TO_LOAD: 14,
PUBLIC_QUICK_AVAILABILITY_ROLLOUT: 100,
SINGLE_ORG_SLUG: "",
} as typeof constants;
export const mockedConstants = { ...initialConstants };
+1 -1
View File
@@ -7,7 +7,7 @@ export const IS_PRODUCTION = CALCOM_ENV === "production";
export const IS_PRODUCTION_BUILD = process.env.NODE_ENV === "production";
export const ORGANIZER_EMAIL_EXEMPT_DOMAINS = process.env.ORGANIZER_EMAIL_EXEMPT_DOMAINS || "";
const IS_DEV = CALCOM_ENV === "development";
export const SINGLE_ORG_SLUG = process.env.NEXT_PUBLIC_SINGLE_ORG_SLUG;
/** https://app.cal.com */
export const WEBAPP_URL =
process.env.NEXT_PUBLIC_WEBAPP_URL ||