aboutsummaryrefslogtreecommitdiff
path: root/api/routes
diff options
context:
space:
mode:
Diffstat (limited to 'api/routes')
-rw-r--r--api/routes/links_routes.py2
-rw-r--r--api/routes/log_routes.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/api/routes/links_routes.py b/api/routes/links_routes.py
index 97b4599..c060f3f 100644
--- a/api/routes/links_routes.py
+++ b/api/routes/links_routes.py
@@ -57,7 +57,7 @@ async def create_link(
link=link_path,
owner=current_user.id,
redirect_link=url.url,
- expire_date=datetime.datetime.utcnow()
+ expire_date=datetime.datetime.today()
+ datetime.timedelta(days=30),
)
db.add(new_link)
diff --git a/api/routes/log_routes.py b/api/routes/log_routes.py
index 5875e3b..438fbf6 100644
--- a/api/routes/log_routes.py
+++ b/api/routes/log_routes.py
@@ -47,9 +47,10 @@ async def get_logs_for_link(
Get all of the logs associated with a specific link
- check to make sure the requester is the owner
"""
+ link = link.upper()
link = (
db.query(Link)
- .filter(Link.owner == current_user.id, Link.short == link)
+ .filter(Link.owner == current_user.id, Link.link == link)
.first()
)
if not link:
@@ -58,7 +59,7 @@ async def get_logs_for_link(
)
logs = (
db.query(Log)
- .filter(Log.link_id == link.id)
+ .filter(Log.link == link.link)
.order_by(Log.timestamp.desc())
.all()
)