removed console logs, removed permission check for getting settings
This commit is contained in:
1 parent
ca30dcc33c
commit
31509247de
3 files changed
+4
-3
No files matched your search
@@ -47,7 +47,6 @@ const AdvancedSettings = ({ isAdmin }) => {
|
|||||||
const getSettings = async () => {
|
const getSettings = async () => {
|
||||||
const action = await dispatch(getAppSettings({ authToken }));
|
const action = await dispatch(getAppSettings({ authToken }));
|
||||||
if (action.payload.success) {
|
if (action.payload.success) {
|
||||||
console.log(action.payload.data);
|
|
||||||
setLocalSettings(action.payload.data);
|
setLocalSettings(action.payload.data);
|
||||||
} else {
|
} else {
|
||||||
createToast({ body: "Failed to get settings" });
|
createToast({ body: "Failed to get settings" });
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ class NetworkService {
|
|||||||
this.setBaseUrl(baseURL);
|
this.setBaseUrl(baseURL);
|
||||||
this.unsubscribe = store.subscribe(() => {
|
this.unsubscribe = store.subscribe(() => {
|
||||||
const state = store.getState();
|
const state = store.getState();
|
||||||
baseURL = state.settings.apiBaseUrl || BASE_URL;
|
if (state.settings.apiBaseUrl) {
|
||||||
|
baseURL = state.settings.apiBaseUrl;
|
||||||
|
}
|
||||||
this.setBaseUrl(baseURL);
|
this.setBaseUrl(baseURL);
|
||||||
});
|
});
|
||||||
this.axiosInstance.interceptors.response.use(
|
this.axiosInstance.interceptors.response.use(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const settingsController = require("../controllers/settingsController");
|
|||||||
const { isAllowed } = require("../middleware/isAllowed");
|
const { isAllowed } = require("../middleware/isAllowed");
|
||||||
const Monitor = require("../models/Monitor");
|
const Monitor = require("../models/Monitor");
|
||||||
|
|
||||||
router.get("/", isAllowed(["superadmin"]), settingsController.getAppSettings);
|
router.get("/", settingsController.getAppSettings);
|
||||||
router.put(
|
router.put(
|
||||||
"/",
|
"/",
|
||||||
isAllowed(["superadmin"]),
|
isAllowed(["superadmin"]),
|
||||||
|
|||||||
Reference in new issue
Block a user