imported routers to fastapi app routers

This commit is contained in:
2025-08-07 18:57:41 +03:00
parent 10310b9416
commit aeed5ea45c
3 changed files with 6 additions and 4 deletions

View File

@ -117,7 +117,7 @@ async def add_swipe(
if value == 0 and group.allow_skips is False: if value == 0 and group.allow_skips is False:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN, status_code=status.HTTP_403_FORBIDDEN,
detail="Skips are disallowed", detail="Skips are disallowed in the group",
) )
result = db.create_swipe(conn, current_user.username, feed_id, picture_id, value) result = db.create_swipe(conn, current_user.username, feed_id, picture_id, value)

View File

@ -3,8 +3,10 @@ import sys
from fastapi import FastAPI from fastapi import FastAPI
from loguru import logger from loguru import logger
from api.accounts import accounts_router
from api.anon import anon_router from api.anon import anon_router
from api.auth import auth_router from api.auth import auth_router
from api.feeds import feeds_router
from api.general import general_router from api.general import general_router
from api.groups import groups_router from api.groups import groups_router
from api.memberships import memberships_router from api.memberships import memberships_router
@ -45,8 +47,10 @@ def create_app():
app.include_router(users_router) app.include_router(users_router)
app.include_router(groups_router) app.include_router(groups_router)
app.include_router(memberships_router) app.include_router(memberships_router)
app.include_router(pictures_router) app.include_router(accounts_router)
app.include_router(feeds_router)
app.include_router(swipes_router) app.include_router(swipes_router)
app.include_router(pictures_router)
app.add_event_handler("shutdown", disconnect_db) app.add_event_handler("shutdown", disconnect_db)
app.add_event_handler("shutdown", settings_down) app.add_event_handler("shutdown", settings_down)

View File

@ -54,8 +54,6 @@ def pixiv(conn: connection, account: Account) -> list[int]:
return pictures_ids return pictures_ids
# TODO: change exceptions. Implement like_picture
def like_picture(conn: connection, account: Account, picture_id: int): def like_picture(conn: connection, account: Account, picture_id: int):
# Getting refresh token # Getting refresh token
refresh_token = account.metadata.get('refresh_token', '') refresh_token = account.metadata.get('refresh_token', '')