rename upload use cases
This commit is contained in:
parent
bd38e350cf
commit
d0810ba4b3
5 changed files with 12 additions and 12 deletions
|
|
@ -16,8 +16,8 @@ class UpdateElement
|
|||
private UpdateRichText $updateRichText,
|
||||
private UpdatePdfPath $updatePdfPath,
|
||||
private UpdateYoutubeUrl $updateYoutubeUrl,
|
||||
private UpdateElementIconImage $updateElementIconImage,
|
||||
private UpdateElementPdf $updateElementPdf,
|
||||
private UpdateIconImage $updateIconImage,
|
||||
private UpdatePdf $updatePdf,
|
||||
private ElementRepository $elementRepository,
|
||||
) {
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ class UpdateElement
|
|||
));
|
||||
}
|
||||
if ($request->iconImageContents !== null) {
|
||||
$this->updateElementIconImage->execute(
|
||||
new UpdateElementIconImageRequest(
|
||||
$this->updateIconImage->execute(
|
||||
new UpdateIconImageRequest(
|
||||
id: $request->id,
|
||||
iconImageContents: $request->iconImageContents,
|
||||
iconImageOriginalName: $request->iconImageOriginalName,
|
||||
|
|
@ -94,8 +94,8 @@ class UpdateElement
|
|||
);
|
||||
}
|
||||
if ($request->pdfContents !== null) {
|
||||
$this->updateElementPdf->execute(
|
||||
new UpdateElementPdfRequest(
|
||||
$this->updatePdf->execute(
|
||||
new UpdatePdfRequest(
|
||||
id: $request->id,
|
||||
pdfContents: $request->pdfContents,
|
||||
pdfOriginalName: $request->pdfOriginalName,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use App\Exceptions\NotFoundException;
|
|||
use App\Shared\Files\FileToUpload;
|
||||
use App\Shared\Files\FileUploader;
|
||||
|
||||
class UpdateElementIconImage
|
||||
class UpdateIconImage
|
||||
{
|
||||
private const ALLOWED_MIME_TYPES = [
|
||||
'image/jpeg',
|
||||
|
|
@ -29,7 +29,7 @@ class UpdateElementIconImage
|
|||
* @throws BadRequestException
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public function execute(UpdateElementIconImageRequest $request): Element
|
||||
public function execute(UpdateIconImageRequest $request): Element
|
||||
{
|
||||
if ($request->id === null) {
|
||||
throw new BadRequestException('id is required');
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Element\UseCases\UpdateElement;
|
||||
|
||||
class UpdateElementIconImageRequest
|
||||
class UpdateIconImageRequest
|
||||
{
|
||||
public function __construct(
|
||||
public ?int $id,
|
||||
|
|
@ -9,7 +9,7 @@ use App\Exceptions\NotFoundException;
|
|||
use App\Shared\Files\FileToUpload;
|
||||
use App\Shared\Files\FileUploader;
|
||||
|
||||
class UpdateElementPdf
|
||||
class UpdatePdf
|
||||
{
|
||||
private const ALLOWED_MIME_TYPES = [
|
||||
'application/pdf',
|
||||
|
|
@ -27,7 +27,7 @@ class UpdateElementPdf
|
|||
* @throws BadRequestException
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public function execute(UpdateElementPdfRequest $request): Element
|
||||
public function execute(UpdatePdfRequest $request): Element
|
||||
{
|
||||
if ($request->id === null) {
|
||||
throw new BadRequestException('id is required');
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Element\UseCases\UpdateElement;
|
||||
|
||||
class UpdateElementPdfRequest
|
||||
class UpdatePdfRequest
|
||||
{
|
||||
public function __construct(
|
||||
public ?int $id,
|
||||
Loading…
Add table
Add a link
Reference in a new issue