Skip to content
Snippets Groups Projects

Development to testing

Merged Ghost User requested to merge Development into testing
1 file
+ 11
30
Compare changes
  • Side-by-side
  • Inline
import {
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
Entity,
Column,
PrimaryGeneratedColumn,
ManyToOne,
Timestamp,
} from 'typeorm';
import { Game_PersonEntity, GameEntity } from '../game/game.entity';
import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
import { FactionEntity } from '../faction/faction.entity';
@Entity('MapDrawing')
@Entity('MapDrawing')
@@ -25,27 +19,14 @@ export class MapDrawingEntity {
@@ -25,27 +19,14 @@ export class MapDrawingEntity {
onDelete: 'CASCADE',
onDelete: 'CASCADE',
})
})
gameId: GameEntity;
gameId: GameEntity;
}
@Entity('Game_Person_MapDrawing')
export class Game_Person_MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') GPmapDrawingId: string;
@Column({ type: 'timestamp' }) GPCTimeStamp: Timestamp;
@ManyToOne(
async ownershipCheck(factionEntity, role) {
type => Game_PersonEntity,
if (role === 'admin') {
game_person => game_person.gamepersonId,
return factionEntity == this.faction;
{
} else {
onDelete: 'CASCADE',
return this.faction && factionEntity.factionId === this.faction.factionId
},
? true
)
: false;
game_person: Game_PersonEntity;
}
@ManyToOne(
}
type => MapDrawingEntity,
map_drawing => map_drawing.mapDrawingId,
{
onDelete: 'CASCADE',
},
)
map_drawing: MapDrawingEntity;
}
}
Loading