Zylinder angefangen

This commit is contained in:
Bastian Wagner
2024-10-24 16:57:30 +02:00
parent 03ae75c83d
commit d4f1fbbf39
15 changed files with 167 additions and 33 deletions

View File

@@ -1,6 +1,8 @@
import {
AfterLoad,
Column,
CreateDateColumn,
DeleteDateColumn,
Entity,
ManyToOne,
OneToMany,
@@ -29,4 +31,16 @@ export class Cylinder {
@UpdateDateColumn({ name: 'updatet_at' })
updatedAt: Date;
@DeleteDateColumn()
deletedAt: Date;
keyCount: number;
@AfterLoad()
countKeys() {
if (this.keys) {
this.keyCount = this.keys.length;
}
}
}

View File

@@ -9,6 +9,6 @@ export class RoleRepository extends Repository<Role> {
}
getStandardRole(): Promise<Role> {
return this.findOne({ where: { name: 'develop' } });
return this.findOne({ where: { name: 'user' } });
}
}