mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-14 19:48:41 +00:00
create account media dir on creation
This commit is contained in:
parent
c2d99b8aa8
commit
1dcfcf258e
|
|
@ -52,6 +52,8 @@ use phpOMS\Uri\HttpUri;
|
||||||
use phpOMS\Utils\Parser\Markdown\Markdown;
|
use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||||
use phpOMS\Validation\Network\Email;
|
use phpOMS\Validation\Network\Email;
|
||||||
use phpOMS\Version\Version;
|
use phpOMS\Version\Version;
|
||||||
|
use Modules\Media\Models\Collection;
|
||||||
|
use Modules\Media\Models\CollectionMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin controller class.
|
* Admin controller class.
|
||||||
|
|
@ -641,8 +643,18 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$account = $this->createAccountFromRequest($request);
|
$account = $this->createAccountFromRequest($request);
|
||||||
|
|
||||||
$this->createModel($request->getHeader()->getAccount(), $account, AccountMapper::class, 'account');
|
$this->createModel($request->getHeader()->getAccount(), $account, AccountMapper::class, 'account');
|
||||||
$this->createProfileForAccount($account, $request);
|
$this->createProfileForAccount($account, $request);
|
||||||
|
|
||||||
|
$collection = new Collection();
|
||||||
|
$collection->setName((string) $account->getId());
|
||||||
|
$collection->setVirtualPath('/Accounts');
|
||||||
|
$collection->setPath('/Accounts');
|
||||||
|
$collection->setCreatedBy(new NullAccount($request->getHeader()->getAccount()));
|
||||||
|
|
||||||
|
CollectionMapper::create($collection);
|
||||||
|
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Account', 'Account successfully created', $account);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Account', 'Account successfully created', $account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user