feat(silo): adjustments completed :D

This commit is contained in:
2025-04-07 07:01:50 -05:00
parent 31fbfa4eb3
commit 75f94eae14
5 changed files with 232 additions and 30 deletions

View File

@@ -45,22 +45,45 @@ export const postAdjustment = async (data: any, prod: any) => {
})
);
let e = error as any;
if (error) {
return {
success: false,
message: "Error in posting the silo adjustment.",
data: {
status: e.response?.status,
statusText: e.response?.statusText,
data: e.response?.data,
},
};
if (e) {
if (e.status === 401) {
const data = {
success: false,
message: "Incorrect alpla prod password.",
data: {
status: e.response?.status,
statusText: e.response?.statusText,
data: e.response?.data,
},
};
return data;
} else {
return {
success: false,
message: "Error in posting the silo adjustment.",
data: {
status: e.response?.status,
statusText: e.response?.statusText,
data: e.response?.data,
},
};
}
}
if (silo.status !== 200) {
if (silo?.status !== 200) {
return {
success: false,
message: "Error in posting the silo adjustment",
data: {
status: silo?.status,
statusText: silo?.statusText,
data: silo?.data,
},
};
} else {
return {
success: true,
message: "Adjustment was completed",
data: {
status: silo.status,
statusText: silo.statusText,
@@ -68,14 +91,4 @@ export const postAdjustment = async (data: any, prod: any) => {
},
};
}
return {
success: true,
message: "Adjustment was completed",
data: {
status: silo.status,
statusText: silo.statusText,
data: silo.data,
},
};
};