WIP: Meldungen

This commit is contained in:
ISA
2025-08-12 12:18:06 +02:00
parent b8b5c36a60
commit 2765d06836
6 changed files with 19 additions and 8 deletions

View File

@@ -13,9 +13,15 @@ export const fetchMessagesService = async (
const tm = String(to.getMonth() + 1).padStart(2, "0");
const td = String(to.getDate()).padStart(2, "0");
const isDev =
typeof window !== "undefined" && window.location.hostname === "localhost";
const url = isDev
const isLocalHost =
typeof window !== "undefined" &&
["localhost", "127.0.0.1", "::1"].includes(window.location.hostname);
const forceMocks =
typeof process !== "undefined" &&
process.env.NEXT_PUBLIC_USE_MOCKS === "1";
const useMocks = forceMocks || isLocalHost;
const url = useMocks
? `/api/cpl/messages?fromDate=${fromDate}&toDate=${toDate}`
: `/CPL?Service/ae.ACP&MSS1=${fy};${fm};${fd};${ty};${tm};${td};All`;