fix(siloadjustmnets): corrected the silo adjustments to account for removed middleware
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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(
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ app.openapi(
|
||||
adjId,
|
||||
data.comment,
|
||||
data.key,
|
||||
c.get("user"),
|
||||
data.username,
|
||||
);
|
||||
|
||||
console.log(addComment);
|
||||
|
||||
Reference in New Issue
Block a user