juggl/juggl-server/api/getProjects.php
2020-11-08 15:21:51 +01:00

29 lines
702 B
PHP

<?php
session_start();
require_once(__DIR__ . "/services/apiBranch.inc.php");
require_once(__DIR__ . "/services/jsonBuilder.inc.php");
require_once(__DIR__ . "/services/responses.inc.php");
require_once(__DIR__ . "/services/jugglDbApi.inc.php");
class GetProjectsBranch extends ApiBranch
{
function get(ParamCleaner $params)
{
respondStatus(405);
}
function post(ParamCleaner $params)
{
$user_id = $params->get("user_id");
$projects = getProjects($user_id);
$json = new JsonBuilder();
$json->addProjects($projects);
respondJson($json);
}
}
$branch = new GetProjectsBranch();
$branch->execute();