<?php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: *');

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require '../../modelo/red_social.php';

$response = array();

$redes_sociales = RedSocial::mdlGetRedesSociales();

if (!$redes_sociales) {
    $response['response'] = 'error';
    $response['data'] = 'No se encontraron redes sociales';
    return;
}

$response['response'] = 'success';
$response['data'] = $redes_sociales;
echo json_encode($response);