mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
refactor(server/tweets): Slight tweaks to twitter handling on server
This commit is contained in:
1 parent
9ffca0d14e
commit
e01057d818
1 file changed
+6
-2
@@ -132,8 +132,12 @@ async function createTweet(identifier: string, tweet: NewTweet): Promise<Tweet>
|
|||||||
tweet.images,
|
tweet.images,
|
||||||
tweet.retweet,
|
tweet.retweet,
|
||||||
]);
|
]);
|
||||||
const insertData = <Tweet[]>results;
|
// This should not be an any type and instead should be
|
||||||
return await getTweet(profile.id, insertData[0].id);
|
// a Tweet[] according to mysql2 documentation. But instead
|
||||||
|
// this exec promise returns the row itself, not an array of rows like it states
|
||||||
|
// Therefore type assertion doesn't work here for correctly typing this out.
|
||||||
|
const insertData = <any>results;
|
||||||
|
return await getTweet(profile.id, insertData.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createTweetReport(tweetId: number, profileId: number): Promise<void> {
|
async function createTweetReport(tweetId: number, profileId: number): Promise<void> {
|
||||||
|
|||||||
Reference in new issue
Block a user