feat(serverdata): added catch if we are not on localhost we cant actaully see the devDir in set
This commit is contained in:
@@ -24,6 +24,7 @@ export const serverData = pgTable(
|
|||||||
shippingHours: text("shippingHours").default('[{"early": "06:30", "late": "23:00"}]'),
|
shippingHours: text("shippingHours").default('[{"early": "06:30", "late": "23:00"}]'),
|
||||||
tiPostTime: text("tiPostTime").default('[{"from": "24", "to": "24"}]'),
|
tiPostTime: text("tiPostTime").default('[{"from": "24", "to": "24"}]'),
|
||||||
otherSettings: jsonb("otherSettings").default([{specialInstructions: "something for ti", active: false}]),
|
otherSettings: jsonb("otherSettings").default([{specialInstructions: "something for ti", active: false}]),
|
||||||
|
isUpgrading: boolean("isUpgrading").default(false),
|
||||||
},
|
},
|
||||||
|
|
||||||
(table) => [
|
(table) => [
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ export function getSettings(token: string) {
|
|||||||
|
|
||||||
const fetchSettings = async (token: string) => {
|
const fetchSettings = async (token: string) => {
|
||||||
const {data} = await axios.get("/api/server/settings", {headers: {Authorization: `Bearer ${token}`}});
|
const {data} = await axios.get("/api/server/settings", {headers: {Authorization: `Bearer ${token}`}});
|
||||||
|
// if we are not localhost ignore the devDir setting.
|
||||||
return data.data;
|
const url: string = window.location.host.split(":")[0];
|
||||||
|
let settingsData = data.data;
|
||||||
|
if (url != "localhost") {
|
||||||
|
settingsData.filter((n: any) => n.name === "devDir");
|
||||||
|
}
|
||||||
|
return settingsData;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user