mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/api: move serializers to func layer
This commit is contained in:
@ -2,10 +2,6 @@ from szurubooru import search
|
||||
from szurubooru.api.base_api import BaseApi
|
||||
from szurubooru.func import auth, snapshots
|
||||
|
||||
def serialize_snapshot(snapshot):
|
||||
earlier_snapshot = snapshots.get_previous_snapshot(snapshot)
|
||||
return snapshots.serialize_snapshot(snapshot, earlier_snapshot)
|
||||
|
||||
class SnapshotListApi(BaseApi):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
@ -14,4 +10,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, snapshots.serialize_snapshot, 'snapshots')
|
||||
|
Reference in New Issue
Block a user