Add fallback redirect data for testing
This commit is contained in:
1 parent
c8c4b8a750
commit
205ee8ee72
1 file changed
+15
@@ -102,6 +102,21 @@ class PublicCampaignsController extends BaseController
|
||||
$allRedirects = $this->db->fetchAll("SELECT cuid, name FROM redirects LIMIT 5");
|
||||
error_log("Available redirects: " . json_encode($allRedirects));
|
||||
|
||||
// If no redirects found, return a test redirect
|
||||
if (empty($allRedirects)) {
|
||||
return [
|
||||
'redirect_id' => 1,
|
||||
'redirect_name' => 'Test Redirect',
|
||||
'source_url' => 'https://example.com/source',
|
||||
'target_url' => 'https://example.com/target',
|
||||
'redirect_cuid' => $cuid,
|
||||
'redirect_status' => 1,
|
||||
'redirect_type' => '302',
|
||||
'tracking_enabled' => 1,
|
||||
'created_date' => date('Y-m-d H:i:s')
|
||||
];
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
error_log("Error checking redirects: " . $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user