forked from mirror/pixelfed
Update CollectionService
This commit is contained in:
parent
c40b2f091f
commit
3bf792072a
3 changed files with 15 additions and 4 deletions
|
@ -2648,6 +2648,9 @@ class ApiV1Controller extends Controller
|
|||
$status->id,
|
||||
$count
|
||||
);
|
||||
$collection->updated_at = now();
|
||||
$collection->save();
|
||||
CollectionService::setCollection($collection->id, $collection);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue