<?php
require_once __DIR__.'/../admin/_auth.php';require_once ROOT_PATH.'/includes/match_functions.php';
if($_SERVER['REQUEST_METHOD']!=='POST')jsonResponse(['ok'=>false,'erro'=>'Método não permitido.'],405);
$admin=afAdminApiUser($pdo);$d=requestJson();
try{$r=afRevisarPartida($pdo,(int)($d['partida_id']??0),0,(string)($d['decisao']??''),sanitize($d['observacao']??''),(int)$admin['id']);jsonResponse(['ok'=>true,'revisao'=>$r]);}catch(Throwable $e){jsonResponse(['ok'=>false,'erro'=>$e->getMessage()],422);}
