This commit is contained in:
Malini 2025-12-19 12:23:47 +05:30
parent e488062aed
commit 89e2bd3785

View File

@ -84,7 +84,68 @@ export const getQuarterPeriods = async (currentYear, currentQuarter) => {
}
};
export const getPreviousForecastData = async (
// export const getPreviousForecastData = async (
// establishmentId,
// quarter,
// year,
// productId
// ) => {
// try {
// const response = await getRequest(
// "/submissions/getPreviousForecastData",
// {
// params: {
// establishment_id: establishmentId,
// quarter,
// year,
// product_id: productId,
// },
// }
// );
// // Always return only backend data
// return response?.data || null;
// } catch (error) {
// console.error("Error fetching previous forecast data:", error);
// return null;
// }
// };
// export const getBeforePreviousData = async (
// establishmentId,
// quarter,
// year,
// productId
// ) => {
// try {
// if (!establishmentId || !quarter || !year || !productId) {
// throw new Error("Missing required parameters");
// }
// const response = await getRequest(
// "/submissions/getBeforePreviousData",
// {
// params: {
// establishment_id: establishmentId,
// current_quarter: quarter,
// current_year: year,
// product_id: productId,
// },
// }
// );
// return response?.data ?? null;
// } catch (error) {
// console.error("Error fetching data:", error);
// return null;
// }
// };
export const getPreviousForecastData = async (
establishmentId,
quarter,
year,
@ -129,8 +190,8 @@ export const getBeforePreviousData = async (
{
params: {
establishment_id: establishmentId,
current_quarter: quarter,
current_year: year,
current_quarter: quarter,
current_year: year,
product_id: productId,
},
}
@ -145,9 +206,6 @@ export const getBeforePreviousData = async (
};
export const getSubmissionHistoryByEstablishment = async (establishmentId, config = {}) => {
try {
if (!establishmentId) {