15 lines
408 B
Python
15 lines
408 B
Python
|
from __future__ import annotations
|
||
|
from flask_restful import Resource
|
||
|
from flask import current_app as app
|
||
|
from typing import TYPE_CHECKING
|
||
|
|
||
|
if TYPE_CHECKING:
|
||
|
from modules.Archive.database import Database
|
||
|
|
||
|
class GetPost(Resource):
|
||
|
def get(self, id):
|
||
|
id = int(id)
|
||
|
db : Database = app.databases["Archive"]
|
||
|
|
||
|
result = db.get_post(id)
|
||
|
return db.wrap_query_response(result)
|