Loading secret-api.php +3 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,9 @@ $collection = $db->secrets; $method = $_SERVER['REQUEST_METHOD']; if ($method === 'POST') { if ($method === 'POST' && isset($_POST['secret'])) { $data = json_decode(file_get_contents('php://input'), true); if (!isset($data['secret'])) { if ($data['secret']) { http_response_code(400); echo json_encode(['error' => '<p class="mb-0">Hmm... noslēpuma lauciņš ir tukšs. Bez tā šī ir tikai "Glabātuve", nevis "Noslēpumu glabātuve" 😅.</p>']); exit; Loading Loading @@ -65,7 +65,7 @@ if ($method === 'POST') { echo json_encode(['id' => $id]); } else if ($method === 'GET') { } else if ($method === 'POST' && isset($_GET['retrieve'])) { $id = $_GET['id'] ?? null; if (!$id) { http_response_code(400); Loading Loading
secret-api.php +3 −3 Original line number Diff line number Diff line Loading @@ -30,9 +30,9 @@ $collection = $db->secrets; $method = $_SERVER['REQUEST_METHOD']; if ($method === 'POST') { if ($method === 'POST' && isset($_POST['secret'])) { $data = json_decode(file_get_contents('php://input'), true); if (!isset($data['secret'])) { if ($data['secret']) { http_response_code(400); echo json_encode(['error' => '<p class="mb-0">Hmm... noslēpuma lauciņš ir tukšs. Bez tā šī ir tikai "Glabātuve", nevis "Noslēpumu glabātuve" 😅.</p>']); exit; Loading Loading @@ -65,7 +65,7 @@ if ($method === 'POST') { echo json_encode(['id' => $id]); } else if ($method === 'GET') { } else if ($method === 'POST' && isset($_GET['retrieve'])) { $id = $_GET['id'] ?? null; if (!$id) { http_response_code(400); Loading