Initial commit of react-revamp for Auditor Portal
This commit is contained in:
35
src/api/activityFeedsService.ts
Normal file
35
src/api/activityFeedsService.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { axiosClient } from './axiosClient';
|
||||
|
||||
export const activityFeedsService = {
|
||||
getAssets: async () => {
|
||||
const response = await axiosClient.get('/api/dashboard/Master/asset_types');
|
||||
return response;
|
||||
},
|
||||
|
||||
getHistoryDates: async (isRectificationEnabled: boolean) => {
|
||||
// Requires dbName and siteIds, which should be handled by axios interceptors or passed in
|
||||
const params = new URLSearchParams({
|
||||
isRectificationEnabled: String(isRectificationEnabled)
|
||||
});
|
||||
const response = await axiosClient.get(`/api/audit/anomaly/get_history_dates?${params.toString()}`);
|
||||
return response;
|
||||
},
|
||||
|
||||
getHistory: async (params: any) => {
|
||||
const queryParams = new URLSearchParams(params);
|
||||
const response = await axiosClient.get(`/api/audit/anomaly/history?${queryParams.toString()}`);
|
||||
return response;
|
||||
},
|
||||
|
||||
// Mocking update anomaly
|
||||
updateAuditedAnomaly: async (site_id: string, anomaly_id: string, payload: any) => {
|
||||
const response = await axiosClient.put(`/api/audit/anomalies/updateAuditedAnomaly/${site_id}/${anomaly_id}`, payload);
|
||||
return response;
|
||||
},
|
||||
|
||||
getOrganizationSites: async (org_id: string) => {
|
||||
const params = new URLSearchParams({ org_id });
|
||||
const response = await axiosClient.get(`/api/dashboard/Master/site?${params.toString()}`);
|
||||
return response;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user