mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
Reports: Corrected the content type
This commit is contained in:
parent
1b2cf8f104
commit
b47781c6b4
2 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@ final class ReportPresenter extends OpenVKPresenter
|
||||||
exit(json_encode([ "error" => tr("error_segmentation") ]));
|
exit(json_encode([ "error" => tr("error_segmentation") ]));
|
||||||
|
|
||||||
// At this moment, only Posts will be implemented
|
// At this moment, only Posts will be implemented
|
||||||
if($this->queryParam("type") == 'posts') {
|
if($this->queryParam("type") == 'post') {
|
||||||
$post = (new Posts)->get(intval($id));
|
$post = (new Posts)->get(intval($id));
|
||||||
if(!$post)
|
if(!$post)
|
||||||
exit(json_encode([ "error" => "Unable to report nonexistent content" ]));
|
exit(json_encode([ "error" => "Unable to report nonexistent content" ]));
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
res = document.querySelector("#uReportMsgInput").value;
|
res = document.querySelector("#uReportMsgInput").value;
|
||||||
xhr = new XMLHttpRequest();
|
xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", "/report.pl/" + {$post->getId()} + "?reason=" + res + "&type=posts", true);
|
xhr.open("GET", "/report.pl/" + {$post->getId()} + "?reason=" + res + "&type=post", true);
|
||||||
xhr.onload = (function() {
|
xhr.onload = (function() {
|
||||||
if(xhr.responseText.indexOf("reason") === -1)
|
if(xhr.responseText.indexOf("reason") === -1)
|
||||||
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);
|
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);
|
||||||
|
|
Loading…
Reference in a new issue