21256 mocked api response

This commit is contained in:
2026-02-04 11:20:29 +00:00
parent dc8958f7a1
commit 3bd1e7e7fe
4 changed files with 266 additions and 90 deletions
+103 -90
View File
@@ -34,7 +34,7 @@ export const getIP = (req) => {
console.info(
"\n====================\n Client IP address: " + ip,
"\n=====================\n"
"\n=====================\n",
);
};
@@ -42,7 +42,7 @@ export const consoleLogger = (err) => {
console.log(
"\n\n/////////////////////////////////////////////////\nRaw Error " +
err +
"\n\n/////////////////////////////////////////////////\n"
"\n\n/////////////////////////////////////////////////\n",
);
var errStr =
"\n\n/////////////////////////////////////////////////\nServer Error " +
@@ -102,7 +102,7 @@ export const getToken = () => {
.post(
`${accessTokenEndpoint}${tenantId}/oauth2/v2.0/token`,
tokenBody,
tokenConfig
tokenConfig,
)
.then((res) => res.data)
.then((data) => {
@@ -191,7 +191,7 @@ export const azureHeadersPagedCustom = (access_token, showNumberOfRecords) => {
export const hashAPIPath = (queryPath) => {
var hashlink = CryptoJS.HmacSHA256(
queryPath,
CryptoJS.enc.Hex.parse(WORDKEY)
CryptoJS.enc.Hex.parse(WORDKEY),
);
hashlink = hashlink.toString(CryptoJS.enc.Hex);
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
@@ -216,7 +216,7 @@ export const getBasicSearch = (searchString) => {
.get(
BASE_URL +
"/api/endpoint/getbasicsearch_api?searchString=" +
searchString
searchString,
)
.then((res) => {
return res.data;
@@ -244,7 +244,7 @@ export const getIncidentbyID = (searchString) => {
.get(
BASE_URL +
"/api/endpoint/getincidentbyid_api?searchString=" +
searchString
searchString,
)
.then((res) => {
return res.data;
@@ -258,7 +258,7 @@ export const getIncidentbyID = (searchString) => {
export const getIsPublishedbyID = (searchString) => {
return axios
.get(
"/api/endpoint/getispublishedbyid_api?searchString=" + searchString
"/api/endpoint/getispublishedbyid_api?searchString=" + searchString,
)
.then((res) => {
return res.data;
@@ -274,7 +274,7 @@ export const getPartSavedAppeal = (searchString) => {
.get(
BASE_URL +
"/api/endpoint/getpartsavedappeal_api?searchString=" +
searchString
searchString,
)
.then((res) => {
return res.data;
@@ -290,7 +290,7 @@ export const getBasicDNSURLSearch = (searchString) => {
.get(
BASE_URL +
"/api/endpoint/getbasicdnsurlsearch_api?searchString=" +
searchString
searchString,
)
.then((res) => {
return res.data;
@@ -313,12 +313,24 @@ export const getSIPSEvents = async (caseid) => {
});
};
export const getSIPSMedia = async (caseid) => {
return axios
.get(BASE_URL + "/api/endpoint/getsipsmedia_api?caseid=" + caseid)
.then((res) => {
return res.data;
})
.catch((error) => {
consoleLogger(error);
return error.response;
});
};
export const getAddressSearchPaged = (
searchString,
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
showNumberOfRecords,
) => {
return axios
.get(
@@ -331,7 +343,7 @@ export const getAddressSearchPaged = (
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
showNumberOfRecords,
)
.then((res) => {
return res.data;
@@ -347,7 +359,7 @@ export const getBasicSearchPaged = (
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
showNumberOfRecords,
) => {
return axios
.get(
@@ -360,7 +372,7 @@ export const getBasicSearchPaged = (
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
showNumberOfRecords,
)
.then((res) => {
return res.data;
@@ -413,7 +425,7 @@ export const getBasicDNSSearchPaged = (
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
showNumberOfRecords,
) => {
return axios
.get(
@@ -424,7 +436,7 @@ export const getBasicDNSSearchPaged = (
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
showNumberOfRecords,
)
.then((res) => res.data)
.catch((error) => {
@@ -438,7 +450,7 @@ export const getAdvancedSearch = (searchString) => {
.get(
BASE_URL +
"/api/endpoint/getadvancedsearch_api?searchstring=" +
JSON.stringify(searchString)
JSON.stringify(searchString),
)
.then((res) => res.data)
.catch((error) => {
@@ -458,7 +470,7 @@ export const getAdvancedSearchPaged = (
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
showNumberOfRecords,
) => {
return axios
.get(
@@ -471,7 +483,7 @@ export const getAdvancedSearchPaged = (
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
showNumberOfRecords,
)
.then((res) => res.data)
.catch((error) => {
@@ -490,7 +502,7 @@ export const getBasicSearchDetails = async (
appealTypeName,
caseReference,
primaryIdAttribute,
incidentID
incidentID,
) => {
return axios
.get(
@@ -500,7 +512,7 @@ export const getBasicSearchDetails = async (
"&primaryIdAttribute=" +
primaryIdAttribute +
"&incidentID=" +
incidentID
incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -512,7 +524,7 @@ export const getBasicPartSavedDetails = (
appealTypeName,
caseReference,
primaryIdAttribute,
incidentID
incidentID,
) => {
//console.log(
// "///////api call: ",
@@ -532,7 +544,7 @@ export const getBasicPartSavedDetails = (
"&primaryIdAttribute=" +
primaryIdAttribute +
"&incidentID=" +
incidentID
incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -544,7 +556,7 @@ export const getBasicSearchDetailsPaged = async (
appealTypeName,
caseReference,
primaryIdAttribute,
incidentIDs
incidentIDs,
) => {
if (!incidentIDs || incidentIDs.length === 0) return [];
@@ -566,11 +578,11 @@ export const getBasicSearchDetailsPaged = async (
.join(" or ");
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
filter
filter,
)}`;
console.log(
`Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
`Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`,
);
try {
@@ -586,7 +598,7 @@ export const getSearchDocumentDetails = (incidentID) => {
return axios
.get(
"/api/endpoint/getsearchdocumentdetails_api?incidentid=" +
incidentID
incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -598,7 +610,7 @@ export const getSearchDocumentDetails = (incidentID) => {
export const getSearchDocumentTypes = (incidentID) => {
return axios
.get(
"/api/endpoint/getsearchdocumentTypes_api?incidentid=" + incidentID
"/api/endpoint/getsearchdocumentTypes_api?incidentid=" + incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -611,7 +623,7 @@ export const getAppealPDFDocs = (incidentID) => {
.get(
BASE_URL +
"/api/endpoint/getappealpdfdocuments_api?incidentid=" +
incidentID
incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -625,7 +637,7 @@ export const getSearchDocumentDetailsPaged = (
orderBy,
fieldSort,
showNumberOfRecords,
documentType
documentType,
) => {
//console.log("to api:", documentType);
return axios
@@ -641,7 +653,7 @@ export const getSearchDocumentDetailsPaged = (
"&showNumberOfRecords=" +
showNumberOfRecords +
"&documentType=" +
documentType
documentType,
)
.then((res) => res.data)
.catch((error) => {
@@ -653,7 +665,7 @@ export const getLinkedCases = (parentIncidentid) => {
return axios
.get(
"/api/endpoint/getlinkedcases_api?parentincidentid=" +
parentIncidentid
parentIncidentid,
)
.then((res) => {
return res.data;
@@ -745,7 +757,7 @@ export const getMandatoryFields = (whichForm) => {
.get(
BASE_URL +
"/api/endpoint/getmandatoryfields_api?whichForm=" +
whichForm
whichForm,
)
.then((res) => res.data)
.catch((error) => {
@@ -767,7 +779,7 @@ export const getPersonalAccount = (contactid) => {
.get(
BASE_URL +
"/api/endpoint/getpersonalaccount_api?contactid=" +
contactid
contactid,
)
.then((res) => {
return res.data;
@@ -787,7 +799,7 @@ export const getPersonalAccount = (contactid) => {
export const getAppealID = (
caseReference,
updateFormCollection,
primaryAttribute
primaryAttribute,
) => {
//console.log(
// "is this the collection?:",
@@ -803,11 +815,11 @@ export const getAppealID = (
"&primaryAttribute=" +
primaryAttribute +
"&caseReference=" +
caseReference
caseReference,
)
.then((res) => {
const result = Object.entries(res.data.value[0]).filter(
([key]) => !key.startsWith("_")
([key]) => !key.startsWith("_"),
)[0][1];
// console.log("result:", res.data);
var appealID = result;
@@ -824,7 +836,7 @@ export const getLogin = (emailAddress, pwd) => {
"/api/endpoint/getlogin_api?emailAddress=" +
emailAddress +
"&pwd=" +
pwd
pwd,
)
.then((res) => res.data)
.catch((error) => {
@@ -837,7 +849,7 @@ export const getMyCases = (loggedInUserId) => {
.get(
BASE_URL +
"/api/endpoint/getmycases_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => {
return res.data;
@@ -852,7 +864,7 @@ export const getMyInvolvements = async (loggedInUserId) => {
const res = await axios.get(
BASE_URL +
"/api/endpoint/getmyinvolvements_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
);
return res.data;
} catch (error) {
@@ -876,7 +888,7 @@ export const getMyRepresentations = (loggedInUserId) => {
.get(
BASE_URL +
"/api/endpoint/getmyrepresentations_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => res.data)
.catch((error) => {
@@ -888,7 +900,7 @@ export const getMyRepresentationsProxy = (loggedInUserId) => {
return axios
.get(
"/api/endpoint/getmyrepresentationsproxy_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => res.data)
.catch((error) => {
@@ -908,7 +920,8 @@ export const getRepresentations = (incidentID) => {
export const getRepresentationsProxy = (incidentID) => {
return axios
.get(
"/api/endpoint/getrepresentationsproxy_api?incidentID=" + incidentID
"/api/endpoint/getrepresentationsproxy_api?incidentID=" +
incidentID,
)
.then((res) => res.data)
.catch((error) => {
@@ -921,7 +934,7 @@ export const getWatchedCases = (loggedInUserId) => {
.get(
BASE_URL +
"/api/endpoint/getwatchedcases_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => res.data)
.catch((error) => {
@@ -933,7 +946,7 @@ export const getWatchedCasesProxy = (loggedInUserId) => {
return axios
.get(
"/api/endpoint/getwatchedcasesproxy_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => res.data)
.catch((error) => {
@@ -945,7 +958,7 @@ export const getAwaitingSubmissionProxy = (loggedInUserId) => {
return axios
.get(
"/api/endpoint/getawaitingsubmissionproxy_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => res.data)
.catch((error) => {
@@ -958,7 +971,7 @@ export const getAwaitingSubmission = (loggedInUserId) => {
.get(
BASE_URL +
"/api/endpoint/getawaitingsubmission_api?loggedInUserId=" +
loggedInUserId
loggedInUserId,
)
.then((res) => {
return res.data;
@@ -988,8 +1001,8 @@ export const getAwaitingSubmissionFromBlob = (containerName) => {
containerName +
hashAPIPath(
"/api/file/getawaitingsubmissionfromblob?container=" +
containerName
)
containerName,
),
)
.then((res) => {
return res.data;
@@ -1015,7 +1028,7 @@ export const getRepsFromBlob = (containerName) => {
BASE_URL +
"/api/file/getrepsblob?container=" +
containerName +
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
hashAPIPath("/api/file/getrepsblob?container=" + containerName),
)
.then((res) => {
return res.data;
@@ -1042,7 +1055,7 @@ export const getRepsFromBlobProxy = async (containerName) => {
try {
const res = await axios.get(
// BASE_URL +
"/api/file/getrepsblobproxy?container=" + containerName
"/api/file/getrepsblobproxy?container=" + containerName,
// +
// hashAPIPath(
// "/api/file/getawaitingsubmissionfromblob?container=" +
@@ -1061,14 +1074,14 @@ export const getAwaitingSubmissionFromBlobProxy = async (containerName) => {
containerName,
"/api/file/getawaitingsubmissionfromblobproxy?container=" +
containerName,
"\n///////////////////////\n"
"\n///////////////////////\n",
);
try {
const res = await axios.get(
BASE_URL +
"/api/file/getawaitingsubmissionfromblobproxy?container=" +
containerName
containerName,
// +
// hashAPIPath(
// "/api/file/getawaitingsubmissionfromblob?container=" +
@@ -1129,7 +1142,7 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
"/api/endpoint/getportalmoduledetailsproxy_api?appealType=" +
appealType +
"&caseReference=" +
caseReference.replace(/\'/g, "''")
caseReference.replace(/\'/g, "''"),
)
.then((res) => res.data)
.catch((error) => {
@@ -1141,7 +1154,7 @@ export const getEmailAccountCheck = (emailAddress) => {
return axios
.get(
"/api/endpoint/getemailaccountcheck_api?emailAddress=" +
emailAddress
emailAddress,
)
.then((res) => res.data)
.catch((error) => {
@@ -1213,7 +1226,7 @@ export const createNewCase = (
lpaID,
contactid,
createBody,
containerName
containerName,
) => {
appealTypeId = parseInt(appealTypeId);
@@ -1250,7 +1263,7 @@ export const createNewCaseBlob = (
contactid,
createBody,
containerName,
lpaName
lpaName,
) => {
appealTypeId = parseInt(appealTypeId);
@@ -1302,14 +1315,14 @@ export const updateCase = async (
updateBody,
updateFormCollection,
primaryAttribute,
caseReference
caseReference,
) => {
var data = updateBody;
var appealObj = await getAppealID(
caseReference,
updateFormCollection,
primaryAttribute
primaryAttribute,
);
var queryUrl =
@@ -1340,14 +1353,14 @@ export const updateCaseBlob = async (
updateBody,
updateFormCollection,
primaryAttribute,
caseReference
caseReference,
) => {
var data = updateBody;
var appealObj = await getAppealID(
caseReference,
updateFormCollection,
primaryAttribute
primaryAttribute,
);
var queryUrl =
@@ -1415,7 +1428,7 @@ export const getCaseByID = (incidentID) => {
// );
return axios
.get(
BASE_URL + "/api/endpoint/getcasebyid_api?incidentID=" + incidentID
BASE_URL + "/api/endpoint/getcasebyid_api?incidentID=" + incidentID,
)
.then((res) => {
return res.data;
@@ -1473,7 +1486,7 @@ export const deleteAwaitingSubmissions = (incidentID) => {
export const deleteAwaitingSubmissionsFromBlob = (
containerID,
casefolderID
casefolderID,
) => {
var queryUrl =
"/api/file/deleteblobcase?container=" +
@@ -1499,7 +1512,7 @@ export const deleteAwaitingSubmissionsFromBlob = (
export const deleteMyRepresentationsFromBlob = (
containerID,
casefolderID,
repfile
repfile,
) => {
var queryUrl =
"/api/file/deleteblobrep?container=" +
@@ -1563,7 +1576,7 @@ export const uploadFiles = async (
formValues,
filesObj,
containerID,
casefolderID
casefolderID,
) => {
let files = filesObj;
@@ -1644,7 +1657,7 @@ export const uploadRepFiles = async (
formValues,
filesObj,
containerID,
casefolderID
casefolderID,
) => {
let files = filesObj;
@@ -1721,7 +1734,7 @@ export const generateAppealPDF = async (
containerID,
casefolderID,
appealType,
fileList
fileList,
) => {
//let files = filesObj;
@@ -1779,8 +1792,8 @@ export const getFilesFromBlob = (containerName, casefolderID) => {
"/api/file/getbloblist?container=" +
containerName +
"&casefolderID=" +
casefolderID
)
casefolderID,
),
)
.then((res) => {
//console.log("//////////----", res.data);
@@ -1798,7 +1811,7 @@ export const getFilesFromBlobproxy = (containerName, casefolderID) => {
"/api/file/getbloblistproxy?container=" +
containerName +
"&casefolderID=" +
casefolderID
casefolderID,
)
.then((res) => {
//console.log("//////////----", res.data);
@@ -1812,7 +1825,7 @@ export const getFilesFromBlobproxy = (containerName, casefolderID) => {
export const getFilesFromBlobHashed = (
containerName,
getblobshash,
casefolderID
casefolderID,
) => {
return axios
.get(
@@ -1820,7 +1833,7 @@ export const getFilesFromBlobHashed = (
containerName +
"&casefolderID=" +
casefolderID +
getblobshash
getblobshash,
)
.then((res) => {
//console.log("//////////----", res.data);
@@ -1835,7 +1848,7 @@ export const deleteBlob = async (
containerName,
blobName,
deleteblobhash,
casefolderID
casefolderID,
) => {
try {
const res = await axios.get(
@@ -1845,7 +1858,7 @@ export const deleteBlob = async (
encodeURIComponent(casefolderID) +
"&blobname=" +
encodeURIComponent(blobName) +
deleteblobhash
deleteblobhash,
);
return res.data;
} catch (error) {
@@ -1858,7 +1871,7 @@ export const deleteRepBlob = async (
blobName,
deleteblobhash,
casefolderID,
filenamePrefix
filenamePrefix,
) => {
try {
const res = await axios.get(
@@ -1868,7 +1881,7 @@ export const deleteRepBlob = async (
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
"&blobname=" +
encodeURIComponent(blobName) +
deleteblobhash
deleteblobhash,
);
return res.data;
} catch (error) {
@@ -1884,14 +1897,14 @@ export const downloadBlob = (containerName, blobName) => {
containerName.toLowerCase() +
"&blobname=" +
blobName,
{ responseType: "blob" }
{ responseType: "blob" },
)
.then((response) => {
//console.log("Downloaded blob content:");
res.setHeader(
"content-disposition",
"attachment; filename=" + blobName
"attachment; filename=" + blobName,
);
//console.log("has downloaded");
@@ -1928,8 +1941,8 @@ export const getProgressFromBlob = async (containerName, casereference) => {
"/api/file/getprogressobjblob?container=" +
encodeURIComponent(containerName) +
"&casefolderID=" +
encodeURIComponent(casereference)
)
encodeURIComponent(casereference),
),
);
return res.data;
} catch (error) {
@@ -1941,7 +1954,7 @@ export const sendEmail = async (
templateId,
emailAddress,
personalisation,
reference
reference,
) => {
var mailData = {
"templateId": templateId,
@@ -2042,7 +2055,7 @@ export const createContainerProxy = (containerName) => {
export const sendCaseCompleteMessage = async (
containerID,
caseReference,
inv
inv,
) => {
var queryUrl =
"/api/file/createappealcompletemessage_api?container=" +
@@ -2071,7 +2084,7 @@ export const sendCaseCompleteMessage = async (
export const sendCaseCompleteMessageProxy = async (
containerID,
caseReference
caseReference,
) => {
var queryUrl =
"/api/file/createappealcompletemessageproxy_api?container=" +
@@ -2098,7 +2111,7 @@ export const sendCaseCompleteMessageProxy = async (
export const sendRepCompleteMessage = async (
containerID,
caseReference,
fileName
fileName,
) => {
var queryUrl =
"/api/file/createrepcompletemessage_api?container=" +
@@ -2210,7 +2223,7 @@ export const getPreferredLanguage = async (email) => {
.get(
BASE_URL +
"/api/endpoint/getpreferredlanguage_api?emailAddress=" +
email
email,
)
.then((res) => {
return res.data;
@@ -2226,7 +2239,7 @@ export const getAppealPDFDocument = async (incidentid) => {
.get(
BASE_URL +
"/api/endpoint/getappealpdfdocuments_api?incidentid=" +
incidentid
incidentid,
)
.then((res) => {
return res.data;
@@ -2251,7 +2264,7 @@ export const getNewAppealsPage = async (
pageNumber,
orderBy,
fieldSort,
showNumberOfRecords
showNumberOfRecords,
) => {
return axios
.get(
@@ -2264,7 +2277,7 @@ export const getNewAppealsPage = async (
"&fieldSort=" +
fieldSort +
"&showNumberOfRecords=" +
showNumberOfRecords
showNumberOfRecords,
)
.then((res) => {
return res.data;
@@ -2282,7 +2295,7 @@ export const getNewDocumentsPaged = async (
showNumberOfRecords,
documentType,
documentOrigin,
selectedWeeks
selectedWeeks,
) => {
console.log(
"/api/admin/getlatestdocuments_api?pageNumber=" +
@@ -2298,7 +2311,7 @@ export const getNewDocumentsPaged = async (
"&numberWeeks=" +
selectedWeeks +
"&documentOrigin=" +
documentOrigin
documentOrigin,
);
return axios
.get(
@@ -2315,7 +2328,7 @@ export const getNewDocumentsPaged = async (
"&numberWeeks=" +
selectedWeeks +
"&documentOrigin=" +
documentOrigin
documentOrigin,
)
.then((res) => {
return res.data;
+149
View File
@@ -0,0 +1,149 @@
import axios from "axios";
import CryptoJS from "crypto-js";
import { azureHeaders, consoleLogger, getToken } from "../../../actions";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const hashAPIPath = (queryPath) => {
var hashlink = CryptoJS.HmacSHA256(
queryPath,
CryptoJS.enc.Hex.parse(WORDKEY),
);
hashlink = hashlink.toString(CryptoJS.enc.Hex);
//return "&hash=" + hashlink;
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
};
// export default async function ApiProxy(req, res) {
// var caseid = req.query.caseid;
// var token = await getToken();
// var queryUrl =
// "pinswg_sipsevents?$filter=_pinswg_sipseventsid_value eq " +
// caseid +
// "&$count=true";
// return axios
// .get(
// WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
// azureHeaders(token.access_token),
// )
// .then(({ data }) => {
// res.status(200).json(data);
// })
// .catch((error) => {
// consoleLogger(error);
// res.status(400).json(error);
// });
// }
export default function ApiProx(req, res) {
const data = {
"@odata.count": 4,
"value": [
{
"pinswg_publishtoweb@OData.Community.Display.V1.FormattedValue":
"Yes",
"pinswg_publishtoweb": true,
"pinswg_uploadstatus": 846040000,
"pinswg_name":
"Puffin Paradise? Exploring Wales Cutest Wildlife Spot (Skomer Travel Guide)",
"pinswg_description":
"Skomer Island is a tiny uninhabited isle off the coast of Pembrokeshire in western Wales. Although it's just ten minutes from the mainland by ferry, it's home to over 40,000 puffins, the largest colony in the world of Manx Shearwaters, and lots of seals.",
"pinswg_latestpublishedversion": "1.0",
"pinswg_latestpublisheddate@OData.Community.Display.V1.FormattedValue":
"2/2/2026",
"pinswg_latestpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentid": "9d4550b7-2000-f111-aa10-002248008e24",
"createdon@OData.Community.Display.V1.FormattedValue":
"2/2/2026 10:19 AM",
"createdon": "2026-02-02T10:19:55Z",
"pinswg_hashlink":
"/api/documents/download/A22258739?hash=51d64c1330ed2fe1fb9aff4658b8eedadf1b062d2b0313b39bc5af786228324b",
"pinswg_mediaLinkEN":
"https://www.youtube.com/watch?v=H7S6CfF_7PI",
"pinswg_mediaLinkCY":
"https://www.youtube.com/watch?v=H7S6CfF_7PI",
},
{
"pinswg_publishtoweb@OData.Community.Display.V1.FormattedValue":
"Yes",
"pinswg_publishtoweb": true,
"pinswg_uploadstatus": 846040000,
"pinswg_name": "Redstone Cross - side roads",
"pinswg_description": "Redstone Cross - side roads",
"pinswg_latestpublishedversion": "1.0",
"pinswg_latestpublisheddate@OData.Community.Display.V1.FormattedValue":
"2/2/2026",
"pinswg_latestpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentid": "9d4550b7-2000-f111-aa10-002248008e24",
"createdon@OData.Community.Display.V1.FormattedValue":
"2/2/2026 10:19 AM",
"createdon": "2026-02-02T10:19:55Z",
"pinswg_hashlink":
"/api/documents/download/A22258739?hash=51d64c1330ed2fe1fb9aff4658b8eedadf1b062d2b0313b39bc5af786228324b",
"pinswg_mediaLinkEN":
"https://www.youtube.com/watch?v=OhxeLV_jPyE",
"pinswg_mediaLinkCY":
"https://www.youtube.com/watch?v=OhxeLV_jPyE",
},
{
"pinswg_publishtoweb@OData.Community.Display.V1.FormattedValue":
"Yes",
"pinswg_publishtoweb": true,
"pinswg_uploadstatus": 846040000,
"pinswg_name":
"Apprenticeships: Dinorwig Power Station (bilingual)",
"pinswg_description": "blah blah blah",
"pinswg_latestpublishedversion": "1.0",
"pinswg_latestpublisheddate@OData.Community.Display.V1.FormattedValue":
"2/2/2026",
"pinswg_latestpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentid": "9d4550b7-2000-f111-aa10-002248008e24",
"createdon@OData.Community.Display.V1.FormattedValue":
"2/2/2026 10:19 AM",
"createdon": "2026-02-02T10:19:55Z",
"pinswg_hashlink":
"/api/documents/download/A22258739?hash=51d64c1330ed2fe1fb9aff4658b8eedadf1b062d2b0313b39bc5af786228324b",
"pinswg_mediaLinkEN":
"https://www.youtube.com/watch?v=9nsmadjgW94",
"pinswg_mediaLinkCY":
"https://www.youtube.com/watch?v=9nsmadjgW94",
},
{
"pinswg_publishtoweb@OData.Community.Display.V1.FormattedValue":
"Yes",
"pinswg_publishtoweb": true,
"pinswg_uploadstatus": 846040000,
"pinswg_name":
"Climate Action Wales - Cardiff Cycle Workshop - Sustainable Cycling in Cardiff",
"pinswg_description": "blah blah blah",
"pinswg_latestpublishedversion": "1.0",
"pinswg_latestpublisheddate@OData.Community.Display.V1.FormattedValue":
"2/2/2026",
"pinswg_latestpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentpublisheddate": "2026-02-02T10:20:46Z",
"pinswg_documentid": "9d4550b7-2000-f111-aa10-002248008e24",
"createdon@OData.Community.Display.V1.FormattedValue":
"2/2/2026 10:19 AM",
"createdon": "2026-02-02T10:19:55Z",
"pinswg_hashlink":
"/api/documents/download/A22258739?hash=51d64c1330ed2fe1fb9aff4658b8eedadf1b062d2b0313b39bc5af786228324b",
"pinswg_mediaLinkEN":
"https://www.youtube.com/watch?v=tRW3tm2Mby8",
"pinswg_mediaLinkCY":
"https://www.youtube.com/watch?v=tRW3tm2Mby8",
},
],
};
return res.status(200).json(data);
}
+8
View File
@@ -8,6 +8,7 @@ export const searchResultsActionTypes = {
SETREPRESENTATIONS: "SETREPRESENTATIONS",
SETDNSCOORDS: "SETDNSCOORDS",
SETEVENTDETAILS: "SETEVENTDETAILS",
SETMEDIADETAILS: "SETMEDIADETAILS",
};
export const getSearchResultshObj = () => (dispatch) => {
@@ -63,3 +64,10 @@ export const setEventDetails = (eventsDetails) => (dispatch) => {
eventDetailsObj: eventsDetails,
});
};
export const setMediaDetails = (mediaDetails) => (dispatch) => {
return dispatch({
type: searchResultsActionTypes.SETMEDIADETAILS,
mediaDetailsObj: mediaDetails,
});
};
+6
View File
@@ -7,6 +7,7 @@ const searchResultsInitialState = {
representationsObj: {},
dnsCoordsObj: {},
eventDetailsObj: {},
mediaDetailsObj: {},
};
export default function reducer(state = searchResultsInitialState, action) {
@@ -42,6 +43,11 @@ export default function reducer(state = searchResultsInitialState, action) {
...state,
eventDetailsObj: action.eventDetailsObj,
};
case searchResultsActionTypes.SETMEDIADETAILS:
return {
...state,
mediaDetailsObj: action.mediaDetailsObj,
};
default:
return state;
}