bump sqlite from 5.1.4 to 5.1.6 (#82) [skip ci]

Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Reviewed-on: #82
This commit is contained in:
Mylloon 2023-03-15 13:25:00 +01:00
parent b585b15959
commit e6fbca485b
Signed by: Forgejo
GPG key ID: E72245C752A07631
2 changed files with 9 additions and 7 deletions

6
package-lock.json generated
View file

@ -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",

View file

@ -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<returnData>(
"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<dbReminder>(
"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<dbReminder>(
"SELECT data, creation_date, expiration_date, id FROM reminder \
WHERE user_id = ? AND (guild_id = ? OR guild_id = 0)",
[userId, guildId ?? 0],