|
|
@ -15,7 +15,6 @@ use IQBall\Core\Model\TeamModel;
|
|
|
|
use IQBall\Core\Validation\DefaultValidators;
|
|
|
|
use IQBall\Core\Validation\DefaultValidators;
|
|
|
|
|
|
|
|
|
|
|
|
class APITeamController {
|
|
|
|
class APITeamController {
|
|
|
|
|
|
|
|
|
|
|
|
private TeamModel $teamModel;
|
|
|
|
private TeamModel $teamModel;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -64,14 +63,14 @@ class APITeamController {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function updateTeam(int $id):HttpResponse{
|
|
|
|
public function updateTeam(int $id): HttpResponse {
|
|
|
|
return APIControl::runChecked([
|
|
|
|
return APIControl::runChecked([
|
|
|
|
'name' => [DefaultValidators::name()],
|
|
|
|
'name' => [DefaultValidators::name()],
|
|
|
|
'picture' => [DefaultValidators::isURL()],
|
|
|
|
'picture' => [DefaultValidators::isURL()],
|
|
|
|
'mainColor' => [DefaultValidators::hexColor()],
|
|
|
|
'mainColor' => [DefaultValidators::hexColor()],
|
|
|
|
'secondaryColor' => [DefaultValidators::hexColor()],
|
|
|
|
'secondaryColor' => [DefaultValidators::hexColor()],
|
|
|
|
], function (HttpRequest $req){
|
|
|
|
], function (HttpRequest $req) {
|
|
|
|
$this->teamModel->editTeam($req['id'],$req['name'], $req['picture'], $req['mainColor'], $req['secondaryColor']);
|
|
|
|
$this->teamModel->editTeam($req['id'], $req['name'], $req['picture'], $req['mainColor'], $req['secondaryColor']);
|
|
|
|
return HttpResponse::fromCode(HttpCodes::OK);
|
|
|
|
return HttpResponse::fromCode(HttpCodes::OK);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|