Initial LinkLog implementation
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from backend.app.services.link_service import list_public_links
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get('/feed')
|
||||
@router.get('/feed/{username}')
|
||||
def public_feed(username: str | None = None):
|
||||
items = list_public_links(username)
|
||||
return [
|
||||
{
|
||||
'id': item['id'],
|
||||
'title': item['title'],
|
||||
'url': item['url'],
|
||||
'comment': item['comment'],
|
||||
'user': {
|
||||
'username': item['username'],
|
||||
'avatar_url': item['avatar_url'],
|
||||
'bio': item['bio'],
|
||||
},
|
||||
'created_at': item['created_at'],
|
||||
}
|
||||
for item in items
|
||||
]
|
||||
Reference in New Issue
Block a user