From a2441839763779fafe52abde8879faa2a042e728 Mon Sep 17 00:00:00 2001 From: Taso Date: Wed, 10 Mar 2021 20:01:19 -0500 Subject: [PATCH] fix(server/types): Fixed type on Tweet create sql resp --- resources/server/sv_twitter.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/server/sv_twitter.ts b/resources/server/sv_twitter.ts index 4d5aa7c..0fc9f5a 100644 --- a/resources/server/sv_twitter.ts +++ b/resources/server/sv_twitter.ts @@ -5,6 +5,7 @@ import events from '../utils/events'; import config from '../utils/config'; import { reportTweetToDiscord } from './discord'; import { mainLogger } from './sv_logger'; +import { ResultSetHeader } from 'mysql2'; const twitterLogger = mainLogger.child({ module: 'twitter' }); @@ -136,8 +137,8 @@ async function createTweet(identifier: string, tweet: NewTweet): Promise // 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 = results; - return await getTweet(profile.id, insertData.id); + const insertData = results; + return await getTweet(profile.id, insertData.insertId); } async function createTweetReport(tweetId: number, profileId: number): Promise {