Skip to content

Commit

Permalink
Merge pull request #21 from AbstractUmbra/master
Browse files Browse the repository at this point in the history
Fix the documentation and application presenting `pastes` where it means `files` in one endpoint
  • Loading branch information
IAmTomahawkx authored Aug 11, 2022
2 parents 7de265e + 9db7fa1 commit c56410d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mystbin/backend/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pydantic import BaseModel


class _File(BaseModel):
class File(BaseModel):
filename: str
content: str
syntax: Optional[str] = None
Expand All @@ -35,7 +35,7 @@ class PastePostResponse(BaseModel):
author_id: Optional[int] = None
created_at: datetime
expires: Optional[datetime] = None
files: List[_File]
files: List[File]
notice: Optional[str]


Expand All @@ -50,7 +50,7 @@ class PasteGetResponse(BaseModel):
expires: Optional[datetime] = None
last_edited: Optional[datetime] = None
views: int
pastes: List[_File]
files: List[File]


class PasteGetAllResponse(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion mystbin/backend/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def get_paste(self, paste_id: str, password: Optional[str] = None) -> Opti
"""
contents = await self._do_query(query, paste_id, conn=conn)
resp = dict(resp[0])
resp["pastes"] = [{a: str(b) for a, b in x.items()} for x in contents]
resp["files"] = [{a: str(b) for a, b in x.items()} for x in contents]

return resp
else:
Expand Down

0 comments on commit c56410d

Please sign in to comment.