juggl/public/api/addProject.php

31 lines
728 B
PHP
Raw Permalink Normal View History

2021-01-03 12:29:41 +01:00
<?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 AddProjectBranch extends ApiBranch
{
function get(ParamCleaner $params)
{
respondStatus(405);
}
function post(ParamCleaner $params)
{
$user_id = $params->get("user_id");
if ($params->exists(["name", "start_date"]) == false) {
respondStatus(400, "Missing parameter");
}
addProject($user_id, $params);
respondStatus(200);
}
}
$branch = new AddProjectBranch();
$branch->execute();