bug fixed in establishemnet
This commit is contained in:
parent
0e65ba4d13
commit
b5f8cb4014
@ -1,8 +1,8 @@
|
||||
import React, { useEffect, useState, useMemo,useCallback } from 'react';
|
||||
import React, { useEffect, useState, useMemo, useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import Table from '@/components/common/Table';
|
||||
import HeaderBar from '@/components/layout/HeaderBar';
|
||||
// import { fetchSubmissionHistory } from '@/services/submissions/submissionService.js';
|
||||
import { resolveEstablishmentId } from '@/services/utils/establishment';
|
||||
import { fetchProducts } from '@/services/masters/masterService';
|
||||
import { fetchSubmissionHistory, getSubmissionAuditHistory } from '@/services/submissions/submissionService';
|
||||
|
||||
@ -71,7 +71,12 @@ const History = () => {
|
||||
// const loadAuditHistory = async () => {
|
||||
// setIsLoadingAudit(true);
|
||||
// try {
|
||||
// const establishmentId = 41; // Replace with dynamic ID if available
|
||||
// const establishmentId = resolveEstablishmentId();
|
||||
// if (!establishmentId) {
|
||||
// console.error('No establishment ID found');
|
||||
// setIsLoadingAudit(false);
|
||||
// return;
|
||||
// }
|
||||
// const response = await getSubmissionAuditHistory(establishmentId, {
|
||||
// year: yearFilter || undefined,
|
||||
// quarter: quarterFilter || undefined,
|
||||
@ -97,7 +102,13 @@ useEffect(() => {
|
||||
const loadAuditHistory = async () => {
|
||||
setIsLoadingAudit(true);
|
||||
try {
|
||||
const establishmentId = 41; // Replace with dynamic ID if available
|
||||
const establishmentId = resolveEstablishmentId();
|
||||
if (!establishmentId) {
|
||||
console.error('No establishment ID found');
|
||||
setIsLoadingAudit(false);
|
||||
showToast('error', 'No establishment ID found. Please log in again.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Extract product_name from selected value ("HS - Product" → "Product")
|
||||
const productName = hscodeFilter.includes(" - ")
|
||||
@ -108,6 +119,7 @@ useEffect(() => {
|
||||
yearFilter,
|
||||
quarterFilter,
|
||||
productName,
|
||||
establishmentId
|
||||
});
|
||||
|
||||
const params = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user