mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/posts: add featured post retrieval
This commit is contained in:
@ -2,7 +2,7 @@ from szurubooru import search
|
||||
from szurubooru.api.base_api import BaseApi
|
||||
from szurubooru.func import auth, snapshots
|
||||
|
||||
def _serialize_snapshot(snapshot):
|
||||
def serialize_snapshot(snapshot):
|
||||
earlier_snapshot = snapshots.get_previous_snapshot(snapshot)
|
||||
return snapshots.serialize_snapshot(snapshot, earlier_snapshot)
|
||||
|
||||
@ -14,4 +14,4 @@ class SnapshotListApi(BaseApi):
|
||||
def get(self, ctx):
|
||||
auth.verify_privilege(ctx.user, 'snapshots:list')
|
||||
return self._search_executor.execute_and_serialize(
|
||||
ctx, _serialize_snapshot, 'snapshots')
|
||||
ctx, serialize_snapshot, 'snapshots')
|
||||
|
Reference in New Issue
Block a user