diff --git a/actions/index.js b/actions/index.js index cba68508..fe665760 100644 --- a/actions/index.js +++ b/actions/index.js @@ -491,6 +491,22 @@ export const getAppealsTypes = () => { }); }; +export const getAppealsTypesForNewAppeal = () => { + return axios + .get(BASE_URL + "/api/endpoint/getappealtypesfornewappeal_api") + .then((res) => res.data) + .catch((error) => { + console.log(error); + let ErrResponse = { + value: [], + errorCode: error.response.status, + errorMsg: error.response.statusText, + }; + + return ErrResponse; + }); +}; + export const getLPA = () => { return axios .get(BASE_URL + "/api/endpoint/getlpa_api") diff --git a/pages/api/endpoint/getappealtypesfornewappeal_api.js b/pages/api/endpoint/getappealtypesfornewappeal_api.js new file mode 100644 index 00000000..2b561553 --- /dev/null +++ b/pages/api/endpoint/getappealtypesfornewappeal_api.js @@ -0,0 +1,66 @@ +const ApiResponse = (req, res) => { + res.statusCode = 200; + res.json({ + "value": [ + { + "value": "Planning Appeal - S78", + "stringmapid": "cb4aa9f2-e275-eb11-aabd-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,000", + "attributevalue": 846040000, + }, + { + "value": "Listed Building and Conservation Area Consent", + "stringmapid": "d3b500b5-1228-ec11-aaca-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,025", + "attributevalue": 846040025, + }, + { + "value": "Householder and Minor Commercial Appeals - HAS/CAS", + "stringmapid": "585d46a7-9138-ec11-aacb-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,004", + "attributevalue": 846040004, + }, + { + "value": "Adverts", + "stringmapid": "c356f05c-7f90-eb11-aac2-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,018", + "attributevalue": 846040018, + }, + { + "value": "Non-Validation", + "stringmapid": "c956f05c-7f90-eb11-aac2-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,024", + "attributevalue": 846040024, + }, + { + "value": "Enforcement Notice Appeal - S174", + "stringmapid": "b656f05c-7f90-eb11-aac2-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,005", + "attributevalue": 846040005, + }, + { + "value": + "High Hedges, Tree Preservation orders, Hedgerows, Tree Replacement Notice.", + "stringmapid": "c256f05c-7f90-eb11-aac2-00224800be9c", + "organizationid": "01191a4d-105f-eb11-aaba-00224800be9c", + "attributevalue@OData.Community.Display.V1.FormattedValue": + "846,040,017", + "attributevalue": 846040017, + }, + ], + }); +}; + +export default ApiResponse; diff --git a/pages/newappeal/index.js b/pages/newappeal/index.js index 6a98c57e..d28b6588 100644 --- a/pages/newappeal/index.js +++ b/pages/newappeal/index.js @@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation"; import Head from "next/head"; import { useRouter } from "next/router"; import { connect } from "react-redux"; -import { getAppealsTypes, getLPA } from "../../actions"; +import { getAppealsTypesForNewAppeal, getLPA } from "../../actions"; import Breadcrumbs from "../../components/breadcrumbs"; import CookieBanner from "../../components/cookieBanner"; import Footer from "../../components/footer"; @@ -130,7 +130,7 @@ export const getServerSideProps = wrapper.getServerSideProps( let loggedInUser = cookies.pinsUser; const [appealTypeData, lpaData, caseData] = await Promise.all([ - await getAppealsTypes(), + await getAppealsTypesForNewAppeal(), await getLPA(), ]);