Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/Http/Controllers/StoryMetsPreparationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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(),
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/storage/api-docs/api-docs.yaml
Original file line number Diff line number Diff line change
@@ -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/).<br />
For authorization you can use the the bearer token you are provided with.
Expand Down
4 changes: 2 additions & 2 deletions src/tests/Feature/StoryMetsPreparationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
);
}
Expand Down Expand Up @@ -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'],
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Feature/StoryMetsStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading