fix(siloadjustmnets): corrected the silo adjustments to account for removed middleware

This commit is contained in:
2025-10-28 19:39:08 -05:00
parent 78a5a4a398
commit e9ff8bb4cb
6 changed files with 32 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
meta {
name: CreateSilo Adjustment
type: http
seq: 3
}
post {
url: {{url}}/lst/old/api/logistics/createsiloadjustment
body: json
auth: inherit
}
body:json {
{
"warehouseId": 51,
"quantity": 60575,
"laneId": 31717,
"username":"matthes01"
}
}
settings {
encodeUrl: true
timeout: 0
}

View File

@@ -7,10 +7,11 @@ import { Button } from "@/components/ui/button";
import { CardContent, CardFooter, CardHeader } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { useAuth } from "@/lib/authClient";
import { LstCard } from "../../extendedUi/LstCard";
export default function Comment(data: any) {
const token = localStorage.getItem("auth_token");
const { session } = useAuth();
const [isSubmitting, setIsSubmitting] = useState(false);
const router = useRouter();
@@ -27,8 +28,8 @@ export default function Comment(data: any) {
{
comment: value.comment,
key: data.id.split("&")[1].replace("amp;", ""),
username: session?.user.username,
},
{ headers: { Authorization: `Bearer ${token}` } },
);
if (res.data.success) {

View File

@@ -43,6 +43,7 @@ export default function SiloCard(data: any) {
quantity: parseFloat(value.newLevel),
warehouseId: silo.WarehouseID,
laneId: silo.LocationID,
username: session?.user.username,
};
try {

View File

@@ -5,7 +5,7 @@ import jwt from "jsonwebtoken";
const { sign, verify } = jwt;
export const authMiddleware: MiddlewareHandler = async (c, next) => {
// console.log("middleware checked");
console.log("middleware checked");
// const cookieHeader = c.req.header("Cookie");
// if (!cookieHeader) return c.json({ error: "Unauthorized" }, 401);

View File

@@ -44,7 +44,7 @@ app.openapi(
try {
try {
//return apiReturn(c, true, access?.message, access?.data, 200);
const createSiloAdj = await createSiloAdjustment(data, c.get("user"));
const createSiloAdj = await createSiloAdjustment(data, data.username);
return c.json(
{

View File

@@ -55,7 +55,7 @@ app.openapi(
adjId,
data.comment,
data.key,
c.get("user"),
data.username,
);
console.log(addComment);