diff --git a/backend/app/Controllers/ElementController.php b/backend/app/Controllers/ElementController.php index 1d6853f..9ad8ed8 100644 --- a/backend/app/Controllers/ElementController.php +++ b/backend/app/Controllers/ElementController.php @@ -72,7 +72,6 @@ class ElementController richText: $this->stringInput($request, 'richText'), shortPdfPath: $this->stringInput($request, 'shortPdfPath'), longPdfPath: $this->stringInput($request, 'longPdfPath'), - pdfPath: $this->stringInput($request, 'pdfPath'), youtubeUrl: $this->stringInput($request, 'youtubeUrl'), fileType: $this->stringInput($request, 'fileType'), fileContents: $file['contents'], @@ -176,7 +175,6 @@ class ElementController * richText: string, * shortPdfPath: string|null, * longPdfPath: string|null, - * pdfPath: string|null, * youtubeUrl: string|null, * } */ @@ -199,10 +197,6 @@ class ElementController $element->getLongPdfPath(), 'element-pdfs/', ), - 'pdfPath' => $this->storageUrl( - $element->getShortPdfPath(), - 'element-pdfs/', - ), 'youtubeUrl' => $element->getYoutubeUrl(), ]; } diff --git a/backend/app/Element/UseCases/UpdateElement/UpdateElement.php b/backend/app/Element/UseCases/UpdateElement/UpdateElement.php index aab9cb8..9f60f24 100644 --- a/backend/app/Element/UseCases/UpdateElement/UpdateElement.php +++ b/backend/app/Element/UseCases/UpdateElement/UpdateElement.php @@ -46,7 +46,6 @@ class UpdateElement && $request->richText === null && $request->shortPdfPath === null && $request->longPdfPath === null - && $request->pdfPath === null && $request->youtubeUrl === null && $request->fileType === null && $request->fileContents === null @@ -88,11 +87,6 @@ class UpdateElement id: $request->id, shortPdfPath: $request->shortPdfPath, )); - } elseif ($request->pdfPath !== null) { - $this->updateShortPdfPath->execute(new UpdateShortPdfPathRequest( - id: $request->id, - shortPdfPath: $request->pdfPath, - )); } if ($request->longPdfPath !== null) { $this->updateLongPdfPath->execute(new UpdateLongPdfPathRequest( diff --git a/backend/app/Element/UseCases/UpdateElement/UpdateElementRequest.php b/backend/app/Element/UseCases/UpdateElement/UpdateElementRequest.php index efa1519..e734390 100644 --- a/backend/app/Element/UseCases/UpdateElement/UpdateElementRequest.php +++ b/backend/app/Element/UseCases/UpdateElement/UpdateElementRequest.php @@ -12,7 +12,6 @@ class UpdateElementRequest public ?string $richText, public ?string $shortPdfPath, public ?string $longPdfPath, - public ?string $pdfPath, public ?string $youtubeUrl, public ?string $fileType, public ?string $fileContents, diff --git a/backend/tests/Unit/Element/UseCases/GetElementTest.php b/backend/tests/Unit/Element/UseCases/GetElementTest.php index ad2e0d9..d4053f5 100644 --- a/backend/tests/Unit/Element/UseCases/GetElementTest.php +++ b/backend/tests/Unit/Element/UseCases/GetElementTest.php @@ -191,7 +191,7 @@ class GetElementTest extends TestCase string $description, ?string $iconImageUrl, string $richText, - ?string $pdfPath, + ?string $shortPdfPath, ?string $youtubeUrl, ?Element $parentElement, ): Element { @@ -201,7 +201,7 @@ class GetElementTest extends TestCase description: $description, iconImageUrl: $iconImageUrl, richText: $richText, - shortPdfPath: $pdfPath, + shortPdfPath: $shortPdfPath, longPdfPath: null, youtubeUrl: $youtubeUrl, parentElement: $parentElement, diff --git a/backend/tests/Unit/Element/UseCases/UpdateElementTest.php b/backend/tests/Unit/Element/UseCases/UpdateElementTest.php index 1002906..6804e7a 100644 --- a/backend/tests/Unit/Element/UseCases/UpdateElementTest.php +++ b/backend/tests/Unit/Element/UseCases/UpdateElementTest.php @@ -83,7 +83,6 @@ class UpdateElementTest extends TestCase richText: '
Updated rich text
', shortPdfPath: '/assets/pdfs/updated.pdf', longPdfPath: '/assets/pdfs/updated-long.pdf', - pdfPath: null, youtubeUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', fileType: null, fileContents: null, @@ -125,42 +124,6 @@ class UpdateElementTest extends TestCase $this->assertSame('Updated title', $persistedElement->getTitle()); } - public function testLegacyPdfPathIsNotAnUpdateField(): void - { - $set = $this->createSet(1, 'Baderech'); - $element = $this->createElement( - $set, - 'Original title', - 'Original description', - null, - 'Original rich text
', - '/assets/pdfs/original.pdf', - '/assets/pdfs/original-long.pdf', - null, - null, - ); - - $this->expectException(BadRequestException::class); - $this->expectExceptionMessage('nothing to update'); - - $this->updateElement->execute(new UpdateElementRequest( - id: $element->getId(), - title: null, - description: null, - iconImageUrl: null, - richText: null, - shortPdfPath: null, - longPdfPath: null, - pdfPath: '/assets/pdfs/legacy-updated.pdf', - youtubeUrl: null, - fileType: null, - fileContents: null, - fileOriginalName: null, - fileMimeType: null, - fileSizeBytes: null, - )); - } - public function testConvertsEmptyNullableFieldsToNull(): void { $set = $this->createSet(1, 'Baderech'); @@ -185,7 +148,6 @@ class UpdateElementTest extends TestCase richText: 'Updated rich text
', shortPdfPath: '', longPdfPath: '', - pdfPath: null, youtubeUrl: '', fileType: null, fileContents: null, @@ -225,7 +187,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: null, @@ -285,7 +246,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: 'iconImage', fileContents: 'binary-image-bytes', @@ -301,7 +261,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: 'shortPdf', fileContents: 'binary-short-pdf-bytes', @@ -318,7 +277,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: 'longPdf', fileContents: 'binary-long-pdf-bytes', @@ -367,7 +325,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: 'binary-image-bytes', @@ -390,7 +347,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: 'audio', fileContents: 'binary-audio-bytes', @@ -413,7 +369,6 @@ class UpdateElementTest extends TestCase richText: 'Updated rich text
', shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: null, @@ -436,7 +391,6 @@ class UpdateElementTest extends TestCase richText: null, shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: null, @@ -459,7 +413,6 @@ class UpdateElementTest extends TestCase richText: 'Updated rich text
', shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: null, @@ -482,7 +435,6 @@ class UpdateElementTest extends TestCase richText: 'Updated rich text
', shortPdfPath: null, longPdfPath: null, - pdfPath: null, youtubeUrl: null, fileType: null, fileContents: null, diff --git a/frontend/rabbi_gerzi/src/stores/elements.ts b/frontend/rabbi_gerzi/src/stores/elements.ts index 25d8b5c..20cca63 100644 --- a/frontend/rabbi_gerzi/src/stores/elements.ts +++ b/frontend/rabbi_gerzi/src/stores/elements.ts @@ -12,7 +12,6 @@ export interface Element extends ChildElement { richText: string shortPdfPath: string | null longPdfPath: string | null - pdfPath: string | null youtubeUrl: string | null } @@ -41,7 +40,6 @@ interface ElementPatchInput { richText?: string shortPdfPath?: string longPdfPath?: string - pdfPath?: string youtubeUrl?: string }