route element file uploads

Add short and long PDF paths to elements, keep pdfPath as a short PDF compatibility alias, and route generic file uploads by fileType.
This commit is contained in:
Yisroel Baum 2026-06-14 23:17:56 +03:00
parent 0d5783ba9c
commit 9bbabc7fa6
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
28 changed files with 686 additions and 214 deletions

View file

@ -35,7 +35,12 @@ class CreateElement
? null
: $request->iconImageUrl;
$richText = $request->richText ?? '';
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
$shortPdfPath = $request->shortPdfPath === ''
? null
: $request->shortPdfPath;
$longPdfPath = $request->longPdfPath === ''
? null
: $request->longPdfPath;
$youtubeUrl = $request->youtubeUrl === ''
? null
: $request->youtubeUrl;
@ -56,7 +61,8 @@ class CreateElement
description: $description,
iconImageUrl: $iconImageUrl,
richText: $richText,
pdfPath: $pdfPath,
shortPdfPath: $shortPdfPath,
longPdfPath: $longPdfPath,
youtubeUrl: $youtubeUrl,
parentElement: null,
));
@ -82,7 +88,8 @@ class CreateElement
description: $description,
iconImageUrl: $iconImageUrl,
richText: $richText,
pdfPath: $pdfPath,
shortPdfPath: $shortPdfPath,
longPdfPath: $longPdfPath,
youtubeUrl: $youtubeUrl,
parentElement: $parentElement,
));

View file

@ -10,7 +10,8 @@ class CreateElementRequest
public ?string $description,
public ?string $iconImageUrl,
public ?string $richText,
public ?string $pdfPath,
public ?string $shortPdfPath,
public ?string $longPdfPath,
public ?string $youtubeUrl,
public ?int $parentElementId,
) {