Update previous links
This commit is contained in:
@@ -109,6 +109,20 @@ def create_link(
|
||||
return record
|
||||
|
||||
|
||||
def find_owned_link_by_title_url(user_id: str, title: str, url: str) -> dict | None:
|
||||
cleaned_url = clean_url(url)
|
||||
with get_connection() as conn:
|
||||
row = conn.execute(
|
||||
'SELECT * FROM links WHERE user_id = ? AND title = ? AND url = ? ORDER BY created_at DESC LIMIT 1',
|
||||
(user_id, title, cleaned_url),
|
||||
).fetchone()
|
||||
if row is None:
|
||||
return None
|
||||
record = dict(row)
|
||||
record['tags'] = get_link_tags(conn, record['id'])
|
||||
return record
|
||||
|
||||
|
||||
def list_public_links(username: str | None = None):
|
||||
with get_connection() as conn:
|
||||
rows = conn.execute(
|
||||
|
||||
Reference in New Issue
Block a user