Merge pull request #14 from nightbug-xx/egkxkg-codex/add-from_user_email-to-response

Add friend character homework listing
This commit is contained in:
nightbug-xx 2025-06-11 10:54:08 +09:00 committed by GitHub
commit b8a2d02c12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ from app.schemas.friend import (
FriendListItem,
)
from app.schemas.character import CharacterResponse
from app.schemas.homework import HomeworkTypeResponse
from app.services import friend_service
from app.models.user import User
@ -75,6 +76,21 @@ def get_friend_characters(
):
return friend_service.get_public_characters_of_friend(db, current_user.id, friend_id)
@router.get("/{friend_id}/characters/{character_id}/homeworks", response_model=list[HomeworkTypeResponse])
def get_friend_character_homeworks(
friend_id: int,
character_id: int,
db: Session = Depends(get_db),
current_user: User = Depends(get_current_user)
):
return friend_service.get_public_homeworks_of_friend_character(
db,
current_user.id,
friend_id,
character_id,
)
@router.delete("/{friend_id}")
def delete_friend(
friend_id: int,