ghost
3 years ago
3 changed files with 31 additions and 3 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
<?php |
||||
|
||||
$response = [ |
||||
'success' => false, |
||||
'message' => _('Internal server error'), |
||||
]; |
||||
|
||||
if (isset($_SESSION['userName']) && isset($_POST['userName'])) { |
||||
|
||||
$result = $_twister->follow($_SESSION['userName'], [$_POST['userName']]); |
||||
|
||||
$response = [ |
||||
'success' => true, |
||||
'message' => _('Followed successfully'), |
||||
]; |
||||
|
||||
} else { |
||||
|
||||
$response = [ |
||||
'success' => false, |
||||
'message' => _('Session expired. Please, reload the page.'), |
||||
]; |
||||
|
||||
} |
||||
|
||||
header('Content-Type: application/json; charset=utf-8'); |
||||
echo json_encode($response); |
Loading…
Reference in new issue