Reports: Corrected the content type

This commit is contained in:
Ilya Prokopenko 2021-09-26 08:42:41 +03:00
parent 1b2cf8f104
commit b47781c6b4
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56
2 changed files with 2 additions and 2 deletions

View file

@ -50,7 +50,7 @@ final class ReportPresenter extends OpenVKPresenter
exit(json_encode([ "error" => tr("error_segmentation") ]));
// At this moment, only Posts will be implemented
if($this->queryParam("type") == 'posts') {
if($this->queryParam("type") == 'post') {
$post = (new Posts)->get(intval($id));
if(!$post)
exit(json_encode([ "error" => "Unable to report nonexistent content" ]));

View file

@ -46,7 +46,7 @@
(function() {
res = document.querySelector("#uReportMsgInput").value;
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() {
if(xhr.responseText.indexOf("reason") === -1)
MessageBox("Ошибка", "Не удалось подать жалобу...", ["OK"], [Function.noop]);