test
This commit is contained in:
parent
b1962da1ec
commit
863cffe55e
11
database.js
11
database.js
@ -216,19 +216,12 @@ const cleanExpiredCodes = async () => {
|
||||
);
|
||||
};
|
||||
|
||||
const updateLastConnection = async (userId) => {
|
||||
const updateLastConnection = async (steamId) => {
|
||||
const connection = getConnection();
|
||||
|
||||
// Le userId est au format gdk_STEAMID, on extrait le Steam ID
|
||||
const steamIdMatch = userId.match(/gdk_(\d+)/);
|
||||
const steamId = steamIdMatch ? steamIdMatch[1] : userId;
|
||||
|
||||
const [result] = await connection.execute(
|
||||
await connection.execute(
|
||||
'UPDATE user_links SET lastConnection = NOW() WHERE steam_id = ?',
|
||||
[steamId]
|
||||
);
|
||||
|
||||
return { success: true, changes: result.affectedRows };
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user