refactor: resolve hotel name directly from HOTEL_NAME env
CI / check (push) Successful in 41s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m1s

resolveHotelName() now returns env.HOTEL_NAME directly — the single source
of truth. The CMS hotel_name site setting and its DEFAULTS entry are removed
as dead code since they no longer influence the displayed name.

Call sites are unchanged (still await resolveHotelName()); only the lookup
behind it is gone, so the public site always shows the configured env name
with no DB round-trip and no preset.
This commit is contained in:
openhands committed 2026-08-27 16:42:12 +02:00
1 parent 164a4f4ef6
commit 750fcb2e5c
4 files changed
+6 -17

No files matched your search

+4 -8
View File
@@ -1,16 +1,12 @@
import "server-only";
import { env } from "@/env";
import { siteSettings } from "@/lib/services/site-settings";
/**
* Resolve the public hotel name: CMS `hotel_name` setting, falling back to the
* required HOTEL_NAME env var. There is no hardcoded preset — the site must be
* configured, otherwise HOTEL_NAME fails validation at startup.
* The public hotel name is read directly from the required HOTEL_NAME env var.
* There is no CMS override or hardcoded preset — the site must be configured,
* otherwise HOTEL_NAME fails validation at startup.
*/
export async function resolveHotelName(): Promise<string> {
const fromSettings = (
await siteSettings.get("hotel_name", env.HOTEL_NAME)
)?.trim();
return fromSettings || env.HOTEL_NAME;
return env.HOTEL_NAME;
}