fix(ocme): cycle count typos

This commit is contained in:
2025-04-01 16:19:25 -05:00
parent 5c642805b1
commit ee3026fa7c
3 changed files with 100 additions and 47 deletions

View File

@@ -41,13 +41,22 @@ export default function OcmeCycleCount() {
setCounting(true);
toast.success(`Cycle count started`);
try {
const res = await axios.post("/ocme/api/v1/cyclecount", data, {
const res = await axios.post("/ocme/api/v1/cycleCount", data, {
headers: { Authorization: `Bearer ${token}` },
});
toast.success(res.data.message);
setData(res.data.data);
setCounting(false);
reset();
if (res.data.success) {
toast.success(res.data.message);
setData(res.data.data);
setCounting(false);
reset();
}
if (res.data.success) {
toast.success(res.data.message);
setCounting(false);
}
} catch (error) {
toast.error("There was an error cycle counting");
setCounting(false);
@@ -137,7 +146,7 @@ export default function OcmeCycleCount() {
<TableHead>Result</TableHead>
</TableRow>
</TableHeader>
{data.length === 0 ? (
{data?.length === 0 ? (
<TableBody>
{Array(10)
.fill(0)