update template and edit import
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
require_once dirname(__DIR__, 2) . '/vendor/autoload.php'; // Torna al livello di public
|
||||
require_once dirname(__FILE__) . '/class/VisualLimsApiClient.class.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
ini_set('display_errors', '0');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
try {
|
||||
$api = VisualLimsApiClient::getInstance();
|
||||
|
||||
// ID del campo custom passato da GET oppure default
|
||||
$customFieldId = isset($_GET['id']) && is_numeric($_GET['id']) ? intval($_GET['id']) : 150;
|
||||
|
||||
// Endpoint con $expand per ottenere i valori
|
||||
$endpoint = "CustomField($customFieldId)?\$expand=CustomFieldsValues";
|
||||
|
||||
// Recupera i dati dal server
|
||||
$data = $api->get($endpoint);
|
||||
|
||||
// Salva la risposta in un file per debug
|
||||
file_put_contents(__DIR__ . '/customfield_values_response.json', json_encode($data));
|
||||
|
||||
// Output JSON al client
|
||||
echo json_encode($data);
|
||||
} catch (Exception $e) {
|
||||
http_response_code(500);
|
||||
echo json_encode([
|
||||
'error' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user