diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 9411cc0a9..8eb1f43e4 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2648,6 +2648,9 @@ class ApiV1Controller extends Controller $status->id, $count ); + $collection->updated_at = now(); + $collection->save(); + CollectionService::setCollection($collection->id, $collection); }); } diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index fca16f033..39b015ac8 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -168,6 +168,10 @@ class CollectionController extends Controller $count ); + $collection->updated_at = now(); + $collection->save(); + CollectionService::setCollection($collection->id, $collection); + return StatusService::get($status->id); } @@ -305,6 +309,10 @@ class CollectionController extends Controller $item->delete(); + $collection->updated_at = now(); + $collection->save(); + CollectionService::setCollection($collection->id, $collection); + return 200; } } diff --git a/app/Services/CollectionService.php b/app/Services/CollectionService.php index c2dfed7ab..8960cdd13 100644 --- a/app/Services/CollectionService.php +++ b/app/Services/CollectionService.php @@ -84,8 +84,8 @@ class CollectionService 'description' => $collection->description, 'thumb' => url('/storage/no-preview.png'), 'url' => $collection->url(), - 'updated_at' => $collection->updated_at, - 'published_at' => $collection->published_at, + 'updated_at' => str_replace('+00:00', 'Z', $collection->updated_at->format(DATE_RFC3339_EXTENDED)), + 'published_at' => str_replace('+00:00', 'Z', $collection->published_at->format(DATE_RFC3339_EXTENDED)), ]; }); @@ -117,8 +117,8 @@ class CollectionService 'description' => $collection->description, 'thumb' => self::getThumb($id), 'url' => $collection->url(), - 'updated_at' => $collection->updated_at, - 'published_at' => $collection->published_at + 'updated_at' => str_replace('+00:00', 'Z', $collection->updated_at->format(DATE_RFC3339_EXTENDED)), + 'published_at' => str_replace('+00:00', 'Z', $collection->published_at->format(DATE_RFC3339_EXTENDED)), ]; Cache::put(self::CACHE_KEY . 'get:' . $id, $res, 86400); $res['post_count'] = self::count($id);