36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
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;
|
|
}
|
|
};
|