<?php
declare(strict_types=1);

require_once dirname(__DIR__) . '/_bootstrap.php';

golder_require_method('GET');
$ctx = golder_api_auth('desktop_sync');
$profileId = trim((string)($_GET['profile_id'] ?? ''));
$limit = (int)($_GET['limit'] ?? 50);

$rows = golder_list_backups($ctx['master'], (int)$ctx['customer_id'], ($profileId !== '' ? $profileId : null), $limit);

golder_json_response(['status' => 'ok', 'items' => $rows]);


