mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 02:14:06 +02:00
cleanup
This commit is contained in:
parent
5986d8552d
commit
73469d2aa1
29 changed files with 140 additions and 149 deletions
|
|
@ -5,6 +5,8 @@ declare(strict_types=1);
|
|||
namespace Demostf\API\Controllers;
|
||||
|
||||
use Demostf\API\Providers\UploadProvider;
|
||||
use Exception;
|
||||
use Flight;
|
||||
use flight\net\Request;
|
||||
use flight\net\Response;
|
||||
|
||||
|
|
@ -32,12 +34,12 @@ class UploadController extends BaseController {
|
|||
try {
|
||||
$result = $this->uploadProvider->upload($key, $red, $blu, $name, $demoFile);
|
||||
if ('Invalid key' === $result) {
|
||||
\Flight::response()->status(401)->write($result)->send();
|
||||
Flight::response()->status(401)->write($result)->send();
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Flight::response()
|
||||
} catch (Exception $e) {
|
||||
Flight::response()
|
||||
->status(500)
|
||||
->write($e->getMessage())
|
||||
->send();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue