mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
fix(server/types): Fixed type on Tweet create sql resp
This commit is contained in:
1 parent
e01057d818
commit
a244183976
1 file changed
+3
-2
@@ -5,6 +5,7 @@ import events from '../utils/events';
|
|||||||
import config from '../utils/config';
|
import config from '../utils/config';
|
||||||
import { reportTweetToDiscord } from './discord';
|
import { reportTweetToDiscord } from './discord';
|
||||||
import { mainLogger } from './sv_logger';
|
import { mainLogger } from './sv_logger';
|
||||||
|
import { ResultSetHeader } from 'mysql2';
|
||||||
|
|
||||||
const twitterLogger = mainLogger.child({ module: 'twitter' });
|
const twitterLogger = mainLogger.child({ module: 'twitter' });
|
||||||
|
|
||||||
@@ -136,8 +137,8 @@ async function createTweet(identifier: string, tweet: NewTweet): Promise<Tweet>
|
|||||||
// a Tweet[] according to mysql2 documentation. But instead
|
// a Tweet[] according to mysql2 documentation. But instead
|
||||||
// this exec promise returns the row itself, not an array of rows like it states
|
// 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.
|
// Therefore type assertion doesn't work here for correctly typing this out.
|
||||||
const insertData = <any>results;
|
const insertData = <ResultSetHeader>results;
|
||||||
return await getTweet(profile.id, insertData.id);
|
return await getTweet(profile.id, insertData.insertId);
|
||||||
}
|
}
|
||||||
|
|
||||||
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