Skip to content

Commit

Permalink
adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimovchik committed Dec 7, 2024
1 parent eda6da3 commit 20418c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rating_api/routes/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ async def create_comment(lecturer_id: int, comment_info: CommentPost, user=Depen
return CommentGet.model_validate(new_comment)

@comment.post('/import', response_model=CommentGetAll)
async def import_comments(comments_info: CommentImportAll, _=Depends(UnionAuth(scopes=["rating.comment.import"]))) -> CommentGetAll:
async def import_comments(comments_info: CommentImportAll,
_=Depends(UnionAuth(scopes=["rating.comment.import"]))) -> CommentGetAll:
"""
Scopes: `["rating.comment.import"]`
Создает комментарии в базе данных RatingAPI
"""
number_of_comments = len(comments_info.comments)
result = CommentGetAll(limit=number_of_comments, offset=number_of_comments, total=number_of_comments)
for comment_info in comments_info.comments:
Expand Down

0 comments on commit 20418c3

Please sign in to comment.