From 9a5d598cc41adefc30cced86d504747f621c4cae Mon Sep 17 00:00:00 2001 From: trenc Date: Wed, 6 May 2026 15:54:41 +0200 Subject: [PATCH 1/3] fix: return correct api endpoint --- .../Http/Controllers/StoryMetsPreparationController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/Http/Controllers/StoryMetsPreparationController.php b/src/app/Http/Controllers/StoryMetsPreparationController.php index be522fd..59aedbd 100644 --- a/src/app/Http/Controllers/StoryMetsPreparationController.php +++ b/src/app/Http/Controllers/StoryMetsPreparationController.php @@ -35,7 +35,7 @@ public function store(int $id, Request $request): JsonResponse $this->sendMetsReadyNotification->send($notificationEmail, $story, 'ready', null); return $this->sendResponse([ 'status' => 'ready', - 'download_url' => url("/stories/{$id}/items/export/mets"), + 'download_url' => url("/v2/stories/{$id}/items/export/mets"), ], 'METS XML is ready', 200); } @@ -58,8 +58,8 @@ public function store(int $id, Request $request): JsonResponse return $this->sendResponse([ 'status' => 'processing', 'batch_id' => $batch->id, - 'status_url' => url("/stories/{$id}/items/exports/mets/status/{$batch->id}"), - 'download_url' => url("/stories/{$id}/items/export/mets"), + 'status_url' => url("/v2/stories/{$id}/items/exports/mets/status/{$batch->id}"), + 'download_url' => url("/v2/stories/{$id}/items/export/mets"), 'totals' => [ 'pages' => $allItems->count(), 'cached' => $allItems->count() - $missingItems->count(), @@ -91,7 +91,7 @@ public function show(int $id, string $batchId): JsonResponse : 0, ], 'download_url' => $batch->finished() - ? url("/stories/{$id}/items/export/mets") + ? url("/v2/stories/{$id}/items/export/mets") : null, ], $status, 200); } From f841f2caf047f0f721c9afcaee253d6bbb512fc0 Mon Sep 17 00:00:00 2001 From: trenc Date: Wed, 6 May 2026 15:55:01 +0200 Subject: [PATCH 2/3] build: bump version --- src/storage/api-docs/api-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/api-docs/api-docs.yaml b/src/storage/api-docs/api-docs.yaml index 5ad6988..07559ee 100644 --- a/src/storage/api-docs/api-docs.yaml +++ b/src/storage/api-docs/api-docs.yaml @@ -1,7 +1,7 @@ openapi: 3.1.1 info: - version: 2.0.0 + version: 2.0.1 title: Transcribathon Platform API v2 description: This is the documentation of the Transcribathon API v2 used by [https:transcribathon.eu](https://transcribathon.eu/).
For authorization you can use the the bearer token you are provided with. From 830bf6803cba7419685b0c3ebaabb5021f4f06d5 Mon Sep 17 00:00:00 2001 From: trenc Date: Wed, 6 May 2026 16:04:33 +0200 Subject: [PATCH 3/3] test: check for correct returning url --- src/tests/Feature/StoryMetsPreparationTest.php | 4 ++-- src/tests/Feature/StoryMetsStatusTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/Feature/StoryMetsPreparationTest.php b/src/tests/Feature/StoryMetsPreparationTest.php index 2592569..094a277 100644 --- a/src/tests/Feature/StoryMetsPreparationTest.php +++ b/src/tests/Feature/StoryMetsPreparationTest.php @@ -311,7 +311,7 @@ public function test_show_returns_ready_for_finished_batch_without_failures(): v $this->assertSame(0, $data['data']['progress']['failed']); $this->assertSame(100, $data['data']['progress']['percent']); $this->assertSame( - url('/stories/' . self::STORY_ID . '/items/export/mets'), + url('/v2/stories/' . self::STORY_ID . '/items/export/mets'), $data['data']['download_url'], ); } @@ -346,7 +346,7 @@ public function test_show_returns_finished_with_failures_for_finished_batch_with $this->assertSame(2, $data['data']['progress']['failed']); $this->assertSame(100, $data['data']['progress']['percent']); $this->assertSame( - url('/stories/' . self::STORY_ID . '/items/export/mets'), + url('/v2/stories/' . self::STORY_ID . '/items/export/mets'), $data['data']['download_url'], ); } diff --git a/src/tests/Feature/StoryMetsStatusTest.php b/src/tests/Feature/StoryMetsStatusTest.php index 1662c93..dbc2ef1 100644 --- a/src/tests/Feature/StoryMetsStatusTest.php +++ b/src/tests/Feature/StoryMetsStatusTest.php @@ -120,7 +120,7 @@ public function test_status_returns_ready_when_batch_is_finished(): void $this->getJson(self::ENDPOINT . "/status/$batch->id") ->assertOk() ->assertJsonPath('data.status', 'ready') - ->assertJsonPath('data.download_url', url('/stories/' . self::STORY_ID . '/items/export/mets')); + ->assertJsonPath('data.download_url', url('/v2/stories/' . self::STORY_ID . '/items/export/mets')); } public function test_status_returns_cancelled_when_batch_is_cancelled(): void