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();
|
const connection = getConnection();
|
||||||
|
await connection.execute(
|
||||||
// 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(
|
|
||||||
'UPDATE user_links SET lastConnection = NOW() WHERE steam_id = ?',
|
'UPDATE user_links SET lastConnection = NOW() WHERE steam_id = ?',
|
||||||
[steamId]
|
[steamId]
|
||||||
);
|
);
|
||||||
|
|
||||||
return { success: true, changes: result.affectedRows };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user