feat(serverdata): added catch if we are not on localhost we cant actaully see the devDir in set

This commit is contained in:
2025-03-15 15:24:11 -05:00
parent ab16059387
commit f3fa617aa5
2 changed files with 8 additions and 2 deletions

View File

@@ -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) => [

View File

@@ -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;
};