From 354f3260a55b53bfb461a37db9d64550bacbfe04 Mon Sep 17 00:00:00 2001 From: Blake Matthes Date: Wed, 19 Mar 2025 17:09:57 -0500 Subject: [PATCH] refactor(consume materail): get token from localstorage as the store isnt wokring properly --- .../logistics/materialHelper/consumption/ConsumeMaterial.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx b/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx index ca53ab2..8d20973 100644 --- a/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx +++ b/frontend/src/components/logistics/materialHelper/consumption/ConsumeMaterial.tsx @@ -3,6 +3,7 @@ import {Button} from "@/components/ui/button"; import {CardHeader} from "@/components/ui/card"; import {Input} from "@/components/ui/input"; import {Label} from "@/components/ui/label"; +import {useSessionStore} from "@/lib/store/sessionStore"; import axios from "axios"; import {useState} from "react"; @@ -12,7 +13,7 @@ import {toast} from "sonner"; export default function ConsumeMaterial() { const {register: register1, handleSubmit: handleSubmit1, reset} = useForm(); const [submitting, setSubmitting] = useState(false); - const token = localStorage.getItem("auth_token"); + const {token} = useSessionStore(); const handleConsume = async (data: any) => { setSubmitting(!submitting);