diff --git a/ipi-survey-platform/src/services/submissions/submissionService.js b/ipi-survey-platform/src/services/submissions/submissionService.js index 35a0abf..fde59e7 100644 --- a/ipi-survey-platform/src/services/submissions/submissionService.js +++ b/ipi-survey-platform/src/services/submissions/submissionService.js @@ -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) {