Nog meer mergefouten eruit gehaald
This commit is contained in:
@@ -5,6 +5,8 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
class NewsController extends Controller
|
class NewsController extends Controller
|
||||||
{
|
{
|
||||||
|
private $EXTERNAL_NEWS_API;
|
||||||
|
|
||||||
private static $NEWS_CATEGORY = 1;
|
private static $NEWS_CATEGORY = 1;
|
||||||
private static $CALENDAR_CATEGORY = 42;
|
private static $CALENDAR_CATEGORY = 42;
|
||||||
private static $EXTERNAL_NEWS_CATEGORY = 44;
|
private static $EXTERNAL_NEWS_CATEGORY = 44;
|
||||||
@@ -35,6 +37,7 @@ QUERY;
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->EXTERNAL_NEWS_API = env('EXTERNAL_NEWS_API', '//');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -273,6 +276,14 @@ QUERY
|
|||||||
$data = array('version' => 1,
|
$data = array('version' => 1,
|
||||||
'news' => new \Model\NewsItem($item['data'], $item['images'], $item['podcast']));
|
'news' => new \Model\NewsItem($item['data'], $item['images'], $item['podcast']));
|
||||||
|
|
||||||
|
if($externalId = (int)$item['data']->external_id) {
|
||||||
|
$externalSource = json_decode(file_get_contents($this->EXTERNAL_NEWS_API . 'news?source=api&externalid=' . (int)$externalId));
|
||||||
|
if($externalSource) {
|
||||||
|
$data['version'] = 2;
|
||||||
|
$data['source'] = $externalSource->news;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return response()->json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user