<?php
require_once __DIR__ . "/../auth/require-auth.php";
require_once __DIR__ . "/../services/db.php";

$data = json_decode(file_get_contents("php://input"), true);

$sql = "UPDATE comments SET body = ? WHERE id = ?";

sqlsrv_query($conn, $sql, [
    $data["body"],
    $data["id"]
]);

echo json_encode(["success" => true]);
