<?php

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

require '../../modelo/conexion.php';
require '../../modelo/faq.php';

$response = array();

$faqs = Faq::mdlGetAllFaqs();

if (!$faqs) {
    $response['response'] = 'error';
    $response['message'] = 'No se encontraron FAQs';
    echo json_encode($response);
    return;
}

$response['response'] = 'success';
$response['data'] = $faqs;

echo json_encode($response);