<?php
require_once './php/Noticia.php';
require_once './php/DetalleNoticia.php';
header('Content-type: application/json');
$noticia = Noticia::find($_POST["id"]);
$detalleNoticia = DetalleNoticia::where("id_noticia",$_POST["id"]);
$detalleNoticia = $detalleNoticia[0];

$noticia->remove();
$detalleNoticia->remove();

$return = ['error' => false];
echo json_encode($return);