ghost
3 years ago
4 changed files with 90 additions and 1 deletions
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
<?php |
||||
|
||||
$response = [ |
||||
'success' => false, |
||||
'message' => _('Internal server error'), |
||||
]; |
||||
|
||||
if (isset($_SESSION['userName'])) { |
||||
|
||||
$userName = isset($_POST['userName']) ? $_POST['userName'] : false; |
||||
|
||||
$result = $_twister->unFollow($_SESSION['userName'], [$_POST['userName']]); |
||||
|
||||
$response = [ |
||||
'success' => true, |
||||
'message' => _('Unfollowed 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