Files
pedwfrontend/pages/api/endpoint/getsipsmedia_api.js
T

115 lines
5.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { respondError, respondSuccess } from "../middleware/apiResponse";
export default function ApiProxy(req, res) {
if (req.method && req.method !== "GET") {
return respondError(res, {
status: 405,
code: "METHOD_NOT_ALLOWED",
message: "Only GET is supported"
});
}
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 respondSuccess(res, data);
}