Skip to content
Snippets Groups Projects
Commit 94a246a1 authored by L4168's avatar L4168
Browse files

convert score timestamps to unix

parent f647667e
No related branches found
No related tags found
3 merge requests!59Development to master,!54Development to testing,!50Mockdata replay
...@@ -12,7 +12,7 @@ import { FactionEntity } from '../faction/faction.entity'; ...@@ -12,7 +12,7 @@ import { FactionEntity } from '../faction/faction.entity';
export class ScoreEntity { export class ScoreEntity {
@PrimaryGeneratedColumn('uuid') scoreId: string; @PrimaryGeneratedColumn('uuid') scoreId: string;
@Column({ type: 'float' }) score: number; @Column({ type: 'float' }) score: number;
@CreateDateColumn({ type: 'timestamp' }) scoreTimeStamp: Timestamp; @Column({ type: 'float' }) scoreTimeStamp: number;
@ManyToOne(type => FactionEntity, factionName => factionName.factionId, { @ManyToOne(type => FactionEntity, factionName => factionName.factionId, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
......
...@@ -44,6 +44,7 @@ export class ScoreService { ...@@ -44,6 +44,7 @@ export class ScoreService {
} }
// add the score for Faction // add the score for Faction
const newScore = await this.scoreRepository.create(scoreData); const newScore = await this.scoreRepository.create(scoreData);
newScore.scoreTimeStamp = Date.now();
await this.scoreRepository.insert(newScore); await this.scoreRepository.insert(newScore);
return { return {
message: 'Score updated!', message: 'Score updated!',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment