ownedClubs → writeableClubs

This commit is contained in:
lalka2016 2023-05-08 16:18:45 +03:00
parent 231cd23eef
commit 46dd7754ae
4 changed files with 6 additions and 6 deletions

View file

@ -71,7 +71,7 @@ class Clubs
*/ */
} }
function getOwnedClubs(int $id): \Traversable function getWriteableClubs(int $id): \Traversable
{ {
$result = DatabaseConnection::i()->getConnection()->query("SELECT * FROM `groups` WHERE `owner` = $id ORDER BY `id`;"); $result = DatabaseConnection::i()->getConnection()->query("SELECT * FROM `groups` WHERE `owner` = $id ORDER BY `id`;");

View file

@ -708,12 +708,12 @@ final class UserPresenter extends OpenVKPresenter
} }
} }
function renderOwnedClubs(int $id) function renderGetWriteableClubs(int $id)
{ {
$this->assertUserLoggedIn(); $this->assertUserLoggedIn();
if($this->user->id == $id) { if($this->user->id == $id) {
$clubs = iterator_to_array((new Clubs)->getOwnedClubs($id)); $clubs = iterator_to_array((new Clubs)->getWriteableClubs($id));
$json = []; $json = [];
foreach($clubs as $club) foreach($clubs as $club)

View file

@ -93,8 +93,8 @@ routes:
handler: "User->increaseRating" handler: "User->increaseRating"
- url: "/id{num}" - url: "/id{num}"
handler: "User->view" handler: "User->view"
- url: "/id{num}/getOwnedClubs" - url: "/id{num}/getWriteableClubs"
handler: "User->ownedClubs" handler: "User->getWriteableClubs"
- url: "/friends{num}" - url: "/friends{num}"
handler: "User->friends" handler: "User->friends"
- url: "/edit" - url: "/edit"

View file

@ -216,7 +216,7 @@ function repostPost(id, hash, owner) {
Function.noop Function.noop
]); ]);
let xhrj = new XMLHttpRequest(); let xhrj = new XMLHttpRequest();
xhrj.open("GET", "id"+owner+"/getOwnedClubs?hash="+hash) xhrj.open("GET", "id"+owner+"/getWriteableClubs?hash="+hash)
xhrj.send() xhrj.send()
xhrj.onload = () => xhrj.onload = () =>
{ {