mirror of
https://github.com/Karaka-Management/oms-Draw.git
synced 2026-02-15 06:38:40 +00:00
Type and cs fixes
This commit is contained in:
parent
4ca0f4d7cd
commit
f8e49e241f
|
|
@ -103,16 +103,16 @@ final class ApiController extends Controller
|
||||||
$this->createLocalFile($fullPath, (string) $request->getData('image'));
|
$this->createLocalFile($fullPath, (string) $request->getData('image'));
|
||||||
|
|
||||||
$status = [
|
$status = [
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
'filename' => $filename,
|
'filename' => $filename,
|
||||||
'name' => (string) $request->getData('title'),
|
'name' => (string) $request->getData('title'),
|
||||||
'size' => File::size($fullPath),
|
'size' => File::size($fullPath),
|
||||||
'extension' => $extension,
|
'extension' => $extension,
|
||||||
'status' => UploadStatus::OK,
|
'status' => UploadStatus::OK,
|
||||||
];
|
];
|
||||||
|
|
||||||
$media = MediaController::createDbEntry($status, $request->getHeader()->getAccount());
|
$media = MediaController::createDbEntry($status, $request->getHeader()->getAccount());
|
||||||
$draw = DrawImage::fromMedia($media);
|
$draw = $media !== null ? DrawImage::fromMedia($media) : null;
|
||||||
|
|
||||||
$this->createModel($request->getHeader()->getAccount(), $draw, DrawImageMapper::class, 'draw');
|
$this->createModel($request->getHeader()->getAccount(), $draw, DrawImageMapper::class, 'draw');
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Draw', 'Draw successfully created.', $draw);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Draw', 'Draw successfully created.', $draw);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ final class DrawImageMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Has one relation.
|
* Has one relation.
|
||||||
*
|
*
|
||||||
* @var array<string, array{mapper:string, self:string, by?:string}>
|
* @var array<string, array{mapper:string, self:string, by?:string, column?:string}>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static array $ownsOne = [
|
protected static array $ownsOne = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user