Browse Source

change request to the GET method

main
ghost 3 years ago
parent
commit
50def6693b
  1. 2
      src/application/controller/api/post/get.php
  2. 2
      src/public/js/module/feed.js

2
src/application/controller/api/post/get.php

@ -8,7 +8,7 @@ $response = [ @@ -8,7 +8,7 @@ $response = [
if (isset($_SESSION['userName'])) {
$userNames = isset($_POST['userName']) && Filter::userName($_POST['userName']) ? [$_POST['userName']] : $_twister->getFollowing($_SESSION['userName']);
$userNames = isset($_GET['userName']) && $_GET['userName'] ? [Filter::userName($_GET['userName'])] : $_twister->getFollowing($_SESSION['userName']);
if ($result = $_twister->getPosts($userNames, APPLICATION_MAX_POST_FEED)) {

2
src/public/js/module/feed.js

@ -100,7 +100,7 @@ var ModuleFeed = { @@ -100,7 +100,7 @@ var ModuleFeed = {
load: function(feed, reFresh) {
$.ajax({
url: 'api/post/get',
type: 'POST',
type: 'GET',
data: {
userName: $(feed).data('username')
},

Loading…
Cancel
Save