completely useless tap logic

This commit is contained in:
2024-04-14 02:24:54 +03:00
parent 4f5d125531
commit 17e0f78ecf
7 changed files with 82 additions and 17 deletions

View File

@ -1,6 +1,7 @@
from datetime import datetime, timedelta, timezone
from typing import Annotated, Union
from sqlalchemy.orm import Session
from uuid import UUID
from fastapi import APIRouter, Depends, HTTPException, status
from fastapi.security import OAuth2PasswordRequestForm
@ -39,3 +40,12 @@ async def create_news(
db: Annotated[Session, Depends(get_db)],
) -> schemas.NewsInDb:
return services.create_news(news=news, current_user=current_user, db=db)
@router.post("/{news_id}/tap")
async def create_news(
news_id: UUID,
db: Annotated[Session, Depends(get_db)],
) -> schemas.TapResponse:
services.tap_news(news_id=news_id, db=db)
return schemas.TapResponse(tap="ok")