Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix getAndCacheTweet setup

Steven Teyfbab4a648564
diff --git a/lib/twitter.ts b/lib/twitter.ts
index 5feac24063..4e82e8aee8 100644
--- a/lib/twitter.ts
+++ b/lib/twitter.ts
@@ -12,10 +12,7 @@ export async function getAndCacheTweet(id: string): Promise<Tweet | null> {
return tweet;
} catch (error) {
// check if the tweet is cached
- const cachedTweet = (await redis.get(`tweet:${id}`)) as string;
- if (cachedTweet) {
- return JSON.parse(cachedTweet);
- }
- return null;
+ const cachedTweet = (await redis.get(`tweet:${id}`)) as Tweet | null;
+ return cachedTweet;
}
}