Fix JSON-LD source API
The source API does not work. Console error is as follow-
Error while handling source TypeError: Cannot read properties of undefined (reading 'json_source') at json_source (src/app/api/source/route.ts:21:66) 19 |
const response = await fetch(${SOLR_URL}/select?${params}); 20 |
const solrResponse: SolrResponseType = await response.json();21 |
return Response.json(JSON.parse(solrResponse.response.docs[0].json_source)); | ^ 22 | } catch (error) { 23 | console.log("Error while handling source", error);
Fix it.