<?php if (!defined('DASHBOARD_ROOT')) define('DASHBOARD_ROOT', realpath(__DIR__ . '/../..')); require_once DASHBOARD_ROOT . '/api/bootstrap.php'; header('Content-Type: application/json'); if ($_SERVER['REQUEST_METHOD'] !== 'POST') { exit(json_encode(['success' => false, 'error' => 'POST required'])); } CSRF::enforce(); RBAC::enforce('delete.content'); $rowId = (int)($_POST['row_id'] ?? 0); if (!$rowId) { exit(json_encode(['success' => false, 'error' => 'row_id required'])); } $row = Database::fetchOne("SELECT id, store_id FROM storefront_rows WHERE id = :id", [':id' => $rowId]); if (!$row) { exit(json_encode(['success' => false, 'error' => 'Row not found'])); } Database::execute("DELETE FROM storefront_rows WHERE id = :id", [':id' => $rowId]); exit(json_encode(['success' => true])); 