From e6fbca485b6476cb9599a73d6b76e7a277c8144e Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Wed, 15 Mar 2023 13:25:00 +0100 Subject: [PATCH] bump sqlite from 5.1.4 to 5.1.6 (#82) [skip ci] Co-authored-by: Mylloon Reviewed-on: https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/pulls/82 --- 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],