why was this ked??! LOL
All checks were successful
Deploy / deploy (push) Successful in 2m38s

This commit is contained in:
Lee
2024-09-28 16:18:49 +01:00
parent 0b2e848383
commit 5bfd8baa3f
3 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,7 @@ export interface IPlayer extends Document {
/**
* The last time the player was tracked
*/
ked: Date;
lastTracked: Date;
/**
* The raw player data.
@ -33,7 +33,7 @@ export interface IPlayer extends Document {
/**
* Gets when this player was last tracked.
*/
getked(): Date;
getLastTracked(): Date;
/**
* Gets the history for the given date
@ -64,13 +64,13 @@ export interface IPlayer extends Document {
// Mongoose Schema definition for Player
const PlayerSchema = new Schema<IPlayer>({
_id: { type: String, required: true },
ked: { type: Date, default: new Date(), required: false },
lastTracked: { type: Date, default: new Date(), required: false },
rawPlayer: { type: Object, required: false },
statisticHistory: { type: Map, default: () => new Map(), required: false },
trackedSince: { type: Date, default: new Date(), required: false },
});
PlayerSchema.methods.getked = function (): Date {
PlayerSchema.methods.getLastTracked = function (): Date {
return this.ked || new Date();
};