parent
59c7077fd9
commit
1e220c473f
5 changed files with 9 additions and 7 deletions
|
@ -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' => "![{$image->name}]({$displayUrl})",
|
||||
],
|
||||
'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…
Reference in a new issue