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"}]'),
|
||||
tiPostTime: text("tiPostTime").default('[{"from": "24", "to": "24"}]'),
|
||||
otherSettings: jsonb("otherSettings").default([{specialInstructions: "something for ti", active: false}]),
|
||||
isUpgrading: boolean("isUpgrading").default(false),
|
||||
},
|
||||
|
||||
(table) => [
|
||||
|
||||
@@ -13,6 +13,11 @@ export function getSettings(token: string) {
|
||||
|
||||
const fetchSettings = async (token: string) => {
|
||||
const {data} = await axios.get("/api/server/settings", {headers: {Authorization: `Bearer ${token}`}});
|
||||
|
||||
return data.data;
|
||||
// if we are not localhost ignore the devDir setting.
|
||||
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