feat: implement audit session module with centralized API service and axios interceptors

This commit is contained in:
2026-06-26 11:36:37 +05:30
parent fc61b4cdb6
commit 9d2acd126c
4 changed files with 11 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ import { axiosClient } from './axiosClient';
export const activityFeedsService = {
getAssets: async () => {
const response = await axiosClient.get('/api/dashboard/Master/asset_types');
const response = await axiosClient.get('/api/audit/Master/asset_types');
return response;
},
@@ -34,7 +34,7 @@ export const activityFeedsService = {
if (params.dbName) {
falseParams.dbName = params.dbName;
}
const response: any = await activityFeedsService.getFalseAnomaly(falseParams);
const resultObj = response?.result || response;
return {
@@ -64,18 +64,18 @@ export const activityFeedsService = {
// Called after normal (non-rectification) true anomaly audit
updateAnomalyInDashboard: async (payload: { site_id: string, anomaly_id: number[] }) => {
const response = await axiosClient.post('/api/audit/auditor/anomaly/update', payload);
const response = await axiosClient.post('/api/audit/auditor/anomaly/submit', payload);
return response;
},
// Called after rectification true anomaly audit
markAnomalyCompleted: async (payload: { anomaly_id: number[], site_id: number }) => {
const response = await axiosClient.post('/api/audit/auditor/anomaly/completed', payload);
const response = await axiosClient.post('/api/audit/auditor/anomaly/close', payload);
return response;
},
getOrganizationSites: async (org_id: string) => {
const response = await axiosClient.get('/api/dashboard/Master/site', {
const response = await axiosClient.get('/api/audit/Master/site', {
params: { org_id }
});
return response;