mirror of
https://github.com/openvk/openvk
synced 2025-07-07 08:19:49 +03:00
ownedClubs → writeableClubs
This commit is contained in:
parent
231cd23eef
commit
46dd7754ae
4 changed files with 6 additions and 6 deletions
|
@ -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`;");
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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 = () =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue