Browse Source

set reading requests to the GET method

main
ghost 3 years ago
parent
commit
038e243c1c
  1. 2
      src/application/controller/api/follow/get.php
  2. 2
      src/application/controller/api/user/avatar.php
  3. 2
      src/application/controller/api/user/profile.php
  4. 2
      src/public/js/module/feed.js
  5. 4
      src/public/js/module/following.js
  6. 2
      src/public/js/module/post.js

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

@ -9,7 +9,7 @@ $response = [ @@ -9,7 +9,7 @@ $response = [
if (isset($_SESSION['userName'])) {
$userName = isset($_POST['userName']) ? $_POST['userName'] : $_SESSION['userName'];
$userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName'];
$followingUsersTotal = 0;
$followingUsers = [];

2
src/application/controller/api/user/avatar.php

@ -8,7 +8,7 @@ $response = [ @@ -8,7 +8,7 @@ $response = [
if (isset($_SESSION['userName'])) {
$userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName'];
$userName = isset($_GET['userName']) ? Filter::userName($_GET['userName']) : $_SESSION['userName'];
if ($avatarVersions = $_twister->getDHT($userName, 'avatar', 's')) {

2
src/application/controller/api/user/profile.php

@ -8,7 +8,7 @@ $response = [ @@ -8,7 +8,7 @@ $response = [
if (isset($_SESSION['userName'])) {
$userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName'];
$userName = isset($_GET['userName']) ? Filter::userName($_GET['userName']) : $_SESSION['userName'];
if ($userProfileVersions = $_twister->getDHT($userName, 'profile', 's')) {

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

@ -74,7 +74,7 @@ var ModuleFeed = { @@ -74,7 +74,7 @@ var ModuleFeed = {
loadAvatar: function(feed, userName) {
$.ajax({
url: 'api/user/avatar',
type: 'POST',
type: 'GET',
data: {
userName: userName
},

4
src/public/js/module/following.js

@ -71,7 +71,7 @@ var ModuleFollowing = { @@ -71,7 +71,7 @@ var ModuleFollowing = {
loadProfile: function(list, userName) {
$.ajax({
url: 'api/user/profile',
type: 'POST',
type: 'GET',
data: {
userName: userName
},
@ -101,7 +101,7 @@ var ModuleFollowing = { @@ -101,7 +101,7 @@ var ModuleFollowing = {
loadAvatar: function(list, userName) {
$.ajax({
url: 'api/user/avatar',
type: 'POST',
type: 'GET',
data: {
userName: userName
},

2
src/public/js/module/post.js

@ -5,7 +5,7 @@ var ModulePost = { @@ -5,7 +5,7 @@ var ModulePost = {
loadAvatar: function(element) {
$.ajax({
url: 'api/user/avatar',
type: 'POST',
type: 'GET',
success: function (response) {
if (response.success) {

Loading…
Cancel
Save