Files
pedwfrontend/actions/services/referenceDataDirectService.js
T

77 lines
2.1 KiB
JavaScript

import axios from "axios";
import { BASE_URL } from "../core/env";
import { consoleLogger } from "../core/logger";
import { logAndReturnEmptyValueErrorResponse } from "./httpServiceUtils";
export const getAppealsTypes = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypes_api")
.then((res) => res.data)
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getProjectTypes = () => {
return axios
.get(BASE_URL + "/api/endpoint/getprojecttypes_api")
.then((res) => res.data)
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getAppealsTypesForNewAppeal = () => {
return axios
.get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api")
.then((res) => res.data)
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getLPA = () => {
return axios
.get(BASE_URL + "/api/endpoint/getlpa_api")
.then((res) => {
return res.data;
})
.catch(logAndReturnEmptyValueErrorResponse);
};
export const getFormData = (whichForm) => {
return axios
.get(BASE_URL + "/api/endpoint/getformdata_api?whichForm=" + whichForm)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
});
};
export const getMandatoryFields = (whichForm) => {
return axios
.get(
BASE_URL +
"/api/endpoint/getmandatoryfields_api?whichForm=" +
whichForm
)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
});
};
export const getPickLists = (whichForm) => {
return axios
.get(BASE_URL + "/api/endpoint/getpicklists_api?whichForm=" + whichForm)
.then((res) => res.data)
.catch((error) => {
consoleLogger(error);
});
};
export const getNotice = () => {
return axios
.get(BASE_URL + "/api/notices")
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
});
};