diff --git a/ServiceAPI/Groups.php b/ServiceAPI/Groups.php index 28f4b321..9eed0e8d 100644 --- a/ServiceAPI/Groups.php +++ b/ServiceAPI/Groups.php @@ -21,7 +21,7 @@ class Groups implements Handler $count = $this->groups->getWriteableClubsCount($this->user->getId()); if(!$count) { - $reject(122, "You don't have any groups with write access"); + $reject("You don't have any groups with write access"); return; } diff --git a/Web/Models/Repositories/Clubs.php b/Web/Models/Repositories/Clubs.php index 41084d58..8e97f3eb 100644 --- a/Web/Models/Repositories/Clubs.php +++ b/Web/Models/Repositories/Clubs.php @@ -75,21 +75,22 @@ class Clubs function getWriteableClubs(int $id): \Traversable { - $result = $this->clubs->where(["owner" => $id]); - $coadmins = $this->coadmins->where(["user" => $id]); + $result = $this->clubs->where("owner", $id); + $coadmins = $this->coadmins->where("user", $id); - foreach($result as $entry) + foreach($result as $entry) { yield new Club($entry); - - foreach($coadmins as $coadmin) + } + + foreach($coadmins as $coadmin) { $cl = new Manager($coadmin); yield $cl->getClub(); - + } } function getWriteableClubsCount(int $id): int { - return sizeof($this->clubs->where(["owner" => $id])) + sizeof($this->coadmins->where(["user" => $id])); + return sizeof($this->clubs->where("owner", $id)) + sizeof($this->coadmins->where("user", $id)); } use \Nette\SmartObject; diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js index 0bc9167d..1d02351a 100644 --- a/Web/static/js/openvk.cls.js +++ b/Web/static/js/openvk.cls.js @@ -217,7 +217,7 @@ async function repostPost(id, hash) { document.getElementById("reposts"+id).insertAdjacentHTML("beforeend", "(1)") //для старого вида постов } }); - xhr.send('text=' + encodeURI(text) + '&type=' + encodeURI(type) + '&groupId=' + encodeURI(groupId) + "&asGroup="+encodeURI(asGroup) + "&signed="+encodeURI(signed)); + xhr.send('text='+encodeURI(text) + '&type='+type + '&groupId='+groupId + "&asGroup="+asGroup + "&signed="+signed); }), Function.noop ]);