Fix duplicated whois

This commit is contained in:
Tarrgon
2026-06-30 15:21:38 -04:00
parent 24610e6521
commit 058f799d62
+1 -1
View File
@@ -58,7 +58,7 @@ export class Database {
static async getDiscordIds(e621Id: string | number): Promise<string[]> { static async getDiscordIds(e621Id: string | number): Promise<string[]> {
// Perhaps this would be better and then we can return all the data: SELECT * FROM (SELECT * FROM discord_names WHERE user_id = ? ORDER BY id DESC) GROUP BY discord_id; // Perhaps this would be better and then we can return all the data: SELECT * FROM (SELECT * FROM discord_names WHERE user_id = ? ORDER BY id DESC) GROUP BY discord_id;
const ids = await Database.db.all<{ discord_id: string }[]>('SELECT DISTINCT discord_id FROM discord_names WHERE user_id = ?', e621Id); const ids = await Database.db.all<{ discord_id: string }[]>('SELECT discord_id FROM discord_names WHERE user_id = ? GROUP BY discord_id_hash', e621Id);
return ids.map(r => Encrypter.decrypt(r.discord_id)); return ids.map(r => Encrypter.decrypt(r.discord_id));
} }