From 2de89abb4e9dfb7031a305f0c77e4505a5a7360e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 15 Mar 2023 13:24:29 +0100 Subject: [PATCH] bump sqlite from 5.1.4 to 5.1.6 --- package-lock.json | 6 +++--- src/utils/reminder.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff4b01d..940b44a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3570,9 +3570,9 @@ } }, "node_modules/sqlite3": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.4.tgz", - "integrity": "sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz", + "integrity": "sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", diff --git a/src/utils/reminder.ts b/src/utils/reminder.ts index 10b6aa3..28ce716 100644 --- a/src/utils/reminder.ts +++ b/src/utils/reminder.ts @@ -228,9 +228,11 @@ export const checkOwnershipReminder = async ( userId: string, guildId: string ) => { + type returnData = { [key: string]: number }; + const data = (await new Promise((ok, ko) => { // Check the ownership - client.db.all( + client.db.all( "SELECT EXISTS ( \ SELECT 1 FROM reminder \ WHERE id = ? \ @@ -247,7 +249,7 @@ export const checkOwnershipReminder = async ( ok(row[0]); } ); - })) as { [key: string]: number }; + })) as returnData; return Object.keys(data).map((key) => data[key])[0] === 0 ? true : false; }; @@ -259,7 +261,7 @@ export const checkOwnershipReminder = async ( export const getReminderInfo = async (client: Client, id: number) => { return (await new Promise((ok, ko) => { // Check the ownership - client.db.all( + client.db.all( "SELECT * FROM reminder \ WHERE id = ?", [id], @@ -329,7 +331,7 @@ export const updateReminder = (client: Client, data: dbReminder) => { const listReminders = async (client: Client, userId: string, guildId: string | null) => { return (await new Promise((ok, ko) => { // Check the ownership - client.db.all( + client.db.all( "SELECT data, creation_date, expiration_date, id FROM reminder \ WHERE user_id = ? AND (guild_id = ? OR guild_id = 0)", [userId, guildId ?? 0], -- 2.45.2