32 lines
769 B
JavaScript
32 lines
769 B
JavaScript
/**
|
|
* @swagger
|
|
* /api/endpoint/getlpa_api:
|
|
* get:
|
|
* tags: [Search]
|
|
* description: Get list of LPA's
|
|
* responses:
|
|
* 200:
|
|
* description: Success
|
|
* security:
|
|
* - relay_auth: []
|
|
*
|
|
*/
|
|
|
|
import { respondError } from "../middleware/apiResponse";
|
|
import { relayGet } from "../middleware/relayForwarding";
|
|
|
|
export default async function ApiProxy(req, res) {
|
|
const queryUrl =
|
|
"accounts?$count=true&$filter=pinswg_isalocalplanningauthorityaccount eq 846040000&$select=name&$orderby=name asc";
|
|
|
|
return relayGet({
|
|
queryUrl,
|
|
res,
|
|
errorResponse: {
|
|
status: 400,
|
|
code: "LPA_FETCH_FAILED",
|
|
message: "Failed to fetch local planning authorities"
|
|
}
|
|
});
|
|
}
|