mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 10:46:43 +02:00
feat(media): clean media api + create an entity per media type
This commit is contained in:
parent
b09acf6c65
commit
fafaa7e689
46 changed files with 482 additions and 610 deletions
|
|
@ -10,7 +10,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Admin\Controllers;
|
||||
|
||||
use App\Entities\Image;
|
||||
use App\Entities\Person;
|
||||
use App\Models\PersonModel;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
|
|
@ -78,6 +77,7 @@ class PersonController extends BaseController
|
|||
}
|
||||
|
||||
$person = new Person([
|
||||
'avatar' => $this->request->getFile('avatar'),
|
||||
'full_name' => $this->request->getPost('full_name'),
|
||||
'unique_name' => $this->request->getPost('unique_name'),
|
||||
'information_url' => $this->request->getPost('information_url'),
|
||||
|
|
@ -85,11 +85,6 @@ class PersonController extends BaseController
|
|||
'updated_by' => user_id(),
|
||||
]);
|
||||
|
||||
$avatarFile = $this->request->getFile('avatar');
|
||||
if ($avatarFile !== null && $avatarFile->isValid()) {
|
||||
$person->avatar = new Image($avatarFile);
|
||||
}
|
||||
|
||||
$personModel = new PersonModel();
|
||||
|
||||
if (! $personModel->insert($person)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue