fix(backend): fix MProfile#createdAt.

This commit is contained in:
Aleksander Wilczyński 2024-12-16 20:20:44 +01:00
parent 8e7806cdb9
commit 545dbe993c
Signed by untrusted user: alekswilc
GPG Key ID: D4464A248E5F27FE
3 changed files with 10 additions and 1 deletions

View File

@ -103,6 +103,8 @@ export class StationsModule
}
player.flags = player.flags.filter(x => x !== "private");
if (!player.createdAt) player.createdAt = new Date(parseInt(player._id.toString().substring(0, 8), 16) * 1000).getTime();
}
const playerData = await PlayerUtil.getPlayerSteamData(player.id);

View File

@ -132,6 +132,8 @@ export class TrainsModule
}
player.flags = player.flags.filter(x => x !== "private");
if (!player.createdAt) player.createdAt = new Date(parseInt(player._id.toString().substring(0, 8), 16) * 1000).getTime();
}
const playerData = await PlayerUtil.getPlayerSteamData(player.id);

View File

@ -86,13 +86,18 @@ export const raw_schema = {
required: false,
default: 0,
},
flags: [
{
type: String,
required: false,
default: []
}
],
createdAt: [
{
type: Number,
required: true
}
]
};