<?php
require "../../db.php";

$id = $_POST['id'] ?? null;
$name = trim($_POST['name'] ?? "");

if (!$id || !$name) {
  http_response_code(400);
  exit;
}

$stmt = $conn->prepare("UPDATE merch_categories SET name=? WHERE id=?");
$stmt->bind_param("si", $name, $id);

if (!$stmt->execute()) {
  http_response_code(500);
}
