integrated EVERYTHING!

This commit is contained in:
StockiP
2022-05-12 18:48:58 +02:00
parent 8e91e4a8f6
commit f1185ade0c
18 changed files with 424 additions and 27 deletions

View File

@@ -1,18 +1,24 @@
<?php
include( $_SERVER['DOCUMENT_ROOT'] . '/logic/userLogic.php' );
$param = "";
$data = "";
$method = "";
isset($_GET["method"]) ? $method = $_GET["method"] : false;
isset($_GET["param"]) ? $param = $_GET["param"] : false;
$logic = new UserLogic();
$result = $logic->handleUserRequests($method, $param);
$method =
$result = true;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$json = file_get_contents('php://input');
$data = json_decode($json, true);
$result = $logic->handleUserRequests($method, $data);
}
if ($result == null) {
response("GET", 400, null);
response('POST', 400, $result);
} else {
response("GET", 200, $result);
response('POST', 200, $result);
}
function response($method, $status, $data)