refactor: Update API calls in inspection management pages to include company-specific filters

- Modified API requests in the inspection management pages for multiple companies to include a `filterCompanyCode` query parameter.
- This change ensures that the data fetched is specific to the respective company, enhancing data accuracy and relevance.
- Aimed at improving the user experience by providing tailored data views across different company implementations.
This commit is contained in:
kjs
2026-04-13 13:55:04 +09:00
parent 77b7a0cdbb
commit 8a2ee0c0e7
7 changed files with 7 additions and 7 deletions
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_10`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_16`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_29`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_30`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_7`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_8`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}
@@ -136,7 +136,7 @@ export default function InspectionManagementPage() {
await Promise.all(
catList.map(async ({ table, col }) => {
try {
const res = await apiClient.get(`/table-categories/${table}/${col}/values`);
const res = await apiClient.get(`/table-categories/${table}/${col}/values?filterCompanyCode=COMPANY_9`);
if (res.data?.data?.length > 0) {
optMap[`${table}.${col}`] = flattenCategories(res.data.data);
}