- falsches .js im API Pfad entfernt - Development lädt jetzt korrekt /api/cpl/opcuaAPIHandler - Production bleibt unverändert
13 lines
464 B
TypeScript
13 lines
464 B
TypeScript
// /redux/thunks/fetchSystemSettingsThunk.ts
|
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
|
import { fetchSystemSettings } from "../../services/fetchSystemSettingsService";
|
|
import { setSystemSettings } from "../slices/systemSettingsSlice";
|
|
|
|
export const fetchSystemSettingsThunk = createAsyncThunk(
|
|
"systemSettings/fetch",
|
|
async (_, { dispatch }) => {
|
|
const data = await fetchSystemSettings();
|
|
if (data) dispatch(setSystemSettings(data));
|
|
}
|
|
);
|