avoid repeated code

This commit is contained in:
Guillermo Giuliana 2022-01-24 12:12:52 -03:00
parent c8890fdaf7
commit 4c00614c4c
1 changed files with 2 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class EditTopicController extends Controller {
public function handler() {
$topic = Topic::getDataStore(Controller::request('topicId'));
$name = Controller::request('name');
$name = Controller::request('name', true);
$iconColor = Controller::request('iconColor');
$private = Controller::request('private');
$icon = Controller::request('icon');
@ -61,9 +61,7 @@ class EditTopicController extends Controller {
throw new RequestException(ERRORS::NAME_ALREADY_USED);
}
if($name) {
$topic->name = Controller::request('name', true);
}
if($name) $topic->name = $name;
if($iconColor) {
$topic->iconColor = $iconColor;