fix(cdr): pass filter parameters as payload object in apiCall
This commit is contained in:
1 parent
7c28a237ba
commit
21a88440c3
3 files changed
+7
-8
No files matched your search
+5
-5
@@ -2281,11 +2281,11 @@ try {
|
||||
case 'get_cdr':
|
||||
Auth::requireAuth();
|
||||
$filters = [
|
||||
'limit' => (int)($_GET['limit'] ?? $payload['limit'] ?? 100),
|
||||
'direction' => (string)($_GET['direction'] ?? $payload['direction'] ?? 'all'),
|
||||
'disposition' => (string)($_GET['disposition'] ?? $payload['disposition'] ?? 'all'),
|
||||
'period' => (string)($_GET['period'] ?? $payload['period'] ?? 'all'),
|
||||
'search' => (string)($_GET['search'] ?? $payload['search'] ?? ''),
|
||||
'limit' => (int)($payload['limit'] ?? $_GET['limit'] ?? 100),
|
||||
'direction' => (string)($payload['direction'] ?? $_GET['direction'] ?? 'all'),
|
||||
'disposition' => (string)($payload['disposition'] ?? $_GET['disposition'] ?? 'all'),
|
||||
'period' => (string)($payload['period'] ?? $_GET['period'] ?? 'all'),
|
||||
'search' => (string)($payload['search'] ?? $_GET['search'] ?? ''),
|
||||
];
|
||||
$cdrData = CdrManager::getCalls($db, $filters);
|
||||
echo json_encode([
|
||||
|
||||
@@ -6105,15 +6105,13 @@ async function loadCdr() {
|
||||
const limit = document.getElementById('cdr-filter-limit')?.value || 100;
|
||||
|
||||
try {
|
||||
const query = new URLSearchParams({
|
||||
const res = await apiCall('get_cdr', {
|
||||
search,
|
||||
period,
|
||||
direction,
|
||||
disposition,
|
||||
limit
|
||||
});
|
||||
|
||||
const res = await apiCall(`get_cdr&${query.toString()}`);
|
||||
if (!res || !res.success) throw new Error(res?.message || 'Erreur lors de la récupération des CDR');
|
||||
|
||||
renderCdrStats(res.stats || {});
|
||||
|
||||
Reference in new issue
Block a user