Zed 4 jaren geleden
bovenliggende
commit
80f7bc0a02
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 2 2
      src/redis_cache.nim
  2. 1 1
      src/routes/timeline.nim

+ 2 - 2
src/redis_cache.nim

@@ -111,10 +111,10 @@ proc getCachedProfile*(username: string; fetch=true): Future[Profile] {.async.}
   elif fetch:
     result = await getProfile(username)
 
-proc getCachedProfileScreenName*(userId: string): Future[string] {.async.} =
+proc getCachedProfileUsername*(userId: string): Future[string] {.async.} =
   let username = await get("i:" & userId)
   if username != redisNil:
-      result = username
+    result = username
   else:
     let profile = await getProfileById(userId)
     result = profile.username

+ 1 - 1
src/routes/timeline.nim

@@ -104,7 +104,7 @@ template respTimeline*(timeline: typed) =
 
 template respUserId*() =
   cond @"user_id".len > 0
-  let username = await getCachedProfileScreenName(@"user_id")
+  let username = await getCachedProfileUsername(@"user_id")
   if username.len > 0:
     redirect("/" & username)
   else: