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

27 lines
667 B
PHP

<?php
session_start();
require_once(__DIR__ . "/services/apiBranch.inc.php");
require_once(__DIR__ . "/services/responses.inc.php");
require_once(__DIR__ . "/services/jugglDbApi.inc.php");
class EndRecordBranch extends ApiBranch
{
function get(ParamCleaner $params)
{
respondStatus(405);
}
function post(ParamCleaner $params)
{
$user_id = $params->get("user_id");
if ($params->exists(["end_time", "record_id"]) == false) {
respondStatus(400, "Missing parameter");
}
updateEndRecord($user_id, $params);
}
}
$branch = new EndRecordBranch();
$branch->execute();