WIP: Meldungen
This commit is contained in:
@@ -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`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user