mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-27 05:30:41 +00:00
parent
59c7077fd9
commit
1e220c473f
5 changed files with 9 additions and 7 deletions
app/Uploads/Controllers
dev/api/responses
tests/Api
|
@ -129,7 +129,7 @@ class ImageGalleryApiController extends ApiController
|
|||
protected function formatForSingleResponse(Image $image): array
|
||||
{
|
||||
$this->imageRepo->loadThumbs($image);
|
||||
$data = $image->getAttributes();
|
||||
$data = $image->toArray();
|
||||
$data['created_by'] = $image->createdBy;
|
||||
$data['updated_by'] = $image->updatedBy;
|
||||
$data['content'] = [];
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
"name": "Admin",
|
||||
"slug": "admin"
|
||||
},
|
||||
"updated_at": "2023-03-15 08:17:37",
|
||||
"created_at": "2023-03-15 08:17:37",
|
||||
"updated_at": "2023-03-15T16:32:09.000000Z",
|
||||
"created_at": "2023-03-15T16:32:09.000000Z",
|
||||
"id": 618,
|
||||
"thumbs": {
|
||||
"gallery": "https:\/\/bookstack.example.com\/uploads\/images\/gallery\/2023-03\/thumbs-150-150\/cute-cat-image.png",
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"id": 618,
|
||||
"name": "cute-cat-image.png",
|
||||
"url": "https:\/\/bookstack.example.com\/uploads\/images\/gallery\/2023-03\/cute-cat-image.png",
|
||||
"created_at": "2023-03-15 08:17:37",
|
||||
"updated_at": "2023-03-15 08:17:37",
|
||||
"created_at": "2023-03-15T16:32:09.000000Z",
|
||||
"updated_at": "2023-03-15T16:32:09.000000Z",
|
||||
"created_by": {
|
||||
"id": 1,
|
||||
"name": "Admin",
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"id": 618,
|
||||
"name": "My updated image name",
|
||||
"url": "https:\/\/bookstack.example.com\/uploads\/images\/gallery\/2023-03\/cute-cat-image.png",
|
||||
"created_at": "2023-03-15 08:17:37",
|
||||
"updated_at": "2023-03-15 08:24:50",
|
||||
"created_at": "2023-03-15T16:32:09.000000Z",
|
||||
"updated_at": "2023-03-15T18:31:14.000000Z",
|
||||
"created_by": {
|
||||
"id": 1,
|
||||
"name": "Admin",
|
||||
|
|
|
@ -232,6 +232,8 @@ class ImageGalleryApiTest extends TestCase
|
|||
'html' => "<a href=\"{$image->url}\" target=\"_blank\"><img src=\"{$displayUrl}\" alt=\"{$image->name}\"></a>",
|
||||
'markdown' => "",
|
||||
],
|
||||
'created_at' => $image->created_at->toISOString(),
|
||||
'updated_at' => $image->updated_at->toISOString(),
|
||||
]);
|
||||
$this->assertStringStartsWith('http://', $resp->json('thumbs.gallery'));
|
||||
$this->assertStringStartsWith('http://', $resp->json('thumbs.display'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue