refactor: last20Messages und digitale Eingänge auf API-gesteuerte Mock-Dateien umgestellt

- Start.js (last20Messages) als JS-Mock in /apiMockData/jsMockFiles gespeichert
- de.js (digitale Eingänge) in /apiMockData/SERVICE verlagert
- Beide werden über eigene API-Endpoints bzw. per Script-Tag aus Development-Verzeichnis geladen
- Kein Zugriff mehr über /public notwendig, Verhalten in DEV und PROD identisch
This commit is contained in:
Ismail Ali
2025-04-15 07:20:17 +02:00
parent c0d6567c90
commit 9e931eed0f
26 changed files with 235 additions and 29 deletions

View File

@@ -5,11 +5,11 @@ export const fetchLast20MessagesFromWindow = async (): Promise<
> => {
if (typeof window === "undefined") return null;
// ✅ Start.js nur bei Bedarf nachladen (Pfad abhängig von Umgebung)
const scriptSrc =
process.env.NEXT_PUBLIC_NODE_ENV === "production"
? "/CPL?/CPL/SERVICE/Start.js"
: "/CPLmockData/SERVICE/Start.js";
const isDev = process.env.NEXT_PUBLIC_NODE_ENV === "development";
const scriptSrc = isDev
? "/api/cpl/last20Messages" // in Dev → per API geladen
: "/CPL?/CPL/SERVICE/Start.js"; // in Prod → echtes Script vom CPL
await new Promise<void>((resolve, reject) => {
const script = document.createElement("script");