Various domain transfer fixes

This commit is contained in:
Pinga 2024-03-05 12:27:51 +02:00
parent d9743c6f50
commit 9625d648a0
3 changed files with 23 additions and 3 deletions

View file

@ -252,7 +252,15 @@ $app->any('/api[/{params:.*}]', function (
'users_audit' => 'user_id', // Continues to use user_id
];
// Check if the special filter condition for the domain table is met
$isSpecialDomainRequest = $tableName === 'domain' && isset($_GET['filter']) && $_GET['filter'] === 'trstatus,nis';
if (array_key_exists($tableName, $columnMap)) {
// If it's a special domain request, bypass the usual filtering
if ($isSpecialDomainRequest) {
return [];
}
// Use registrarId for tables where 'registrar_id' is the filter
// For 'support_tickets' and 'users_audit', use userId
return [$columnMap[$tableName] => (in_array($tableName, ['support_tickets', 'users_audit']) ? $_SESSION['auth_user_id'] : $registrarId)];