Compare commits

...

6 Commits

6 changed files with 20 additions and 7 deletions

View File

@@ -27,6 +27,7 @@ import {
CollapsibleTrigger, CollapsibleTrigger,
} from "../../ui/collapsible"; } from "../../ui/collapsible";
import { useSubModuleStore } from "@/lib/store/useSubModuleStore"; import { useSubModuleStore } from "@/lib/store/useSubModuleStore";
import { useSettingStore } from "@/lib/store/useSettings";
const iconMap: any = { const iconMap: any = {
ShieldCheck: ShieldCheck, ShieldCheck: ShieldCheck,
@@ -41,6 +42,9 @@ const iconMap: any = {
export function AdminSideBar() { export function AdminSideBar() {
const { subModules } = useSubModuleStore(); const { subModules } = useSubModuleStore();
const { settings } = useSettingStore();
const plantToken = settings.filter((n) => n.name === "plantToken");
const items = subModules.filter((m) => m.moduleName === "admin"); const items = subModules.filter((m) => m.moduleName === "admin");
return ( return (
@@ -87,7 +91,10 @@ export function AdminSideBar() {
> >
<a <a
href={ href={
i.link i.name ===
"Swagger"
? `https://${plantToken[0].value}prod.alpla.net/application/swagger/index.html`
: i.link
} }
target={ target={
i.newWindow i.newWindow

View File

@@ -35,7 +35,7 @@
} }
}, },
"admConfig": { "admConfig": {
"build": 305, "build": 307,
"oldBuild": "backend-0.1.3.zip" "oldBuild": "backend-0.1.3.zip"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -39,13 +39,13 @@ export const getOpenOrders = async (data: any | null) => {
} catch (error) { } catch (error) {
return { return {
success: false, success: false,
message: "Current open orders", message: "Errot getting current open orders",
data: orders.data, data: [],
}; };
} }
// add plant token in // add plant token in
const pOrders = orders.map((item: any) => { const pOrders = orders.data.map((item: any) => {
// const dateCon = new Date(item.loadingDate).toLocaleString("en-US", { // const dateCon = new Date(item.loadingDate).toLocaleString("en-US", {
// month: "numeric", // month: "numeric",
// day: "numeric", // day: "numeric",

View File

@@ -32,6 +32,7 @@ app.openapi(
); );
if (error) { if (error) {
console.log(error);
return c.json( return c.json(
{ {
success: false, success: false,

View File

@@ -5,9 +5,14 @@ import { ppooQuery } from "../../../../sqlServer/querys/warehouse/ppooQuery.js";
export const getPPOO = async () => { export const getPPOO = async () => {
const { data, error } = await tryCatch(query(ppooQuery, "Get PPOO")); const { data, error } = await tryCatch(query(ppooQuery, "Get PPOO"));
const ppoo: any = data as any;
if (error) { if (error) {
return { success: false, message: "Error getting ppoo", data: error }; return { success: false, message: "Error getting ppoo", data: error };
} }
return { success: true, message: "Current pallets in PPOO.", data: data }; return {
success: true,
message: "Current pallets in PPOO.",
data: ppoo.data,
};
}; };

View File

@@ -128,7 +128,7 @@ const newSubModules = [
name: "Swagger", name: "Swagger",
link: "#", link: "#",
icon: "Webhook", icon: "Webhook",
newWindow: false, newWindow: true,
isActive: true, isActive: true,
}, },
{ {