Skip to content

Commit

Permalink
add user interface
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelneu committed May 1, 2019
1 parent ff8fff1 commit 036b73f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/src/entities/activity.ts
@@ -1,5 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { ActivityType } from "../../../types/activity";
import { IUser } from "../../../types/user";
import { User } from "./user";

@Entity()
Expand All @@ -8,7 +9,7 @@ export class Activity {
public id!: number;

@ManyToOne(() => User, (user) => user.activity)
public user!: User;
public user!: IUser;

@Column()
public type!: ActivityType;
Expand Down
3 changes: 2 additions & 1 deletion backend/src/entities/user.ts
Expand Up @@ -2,10 +2,11 @@ import { Exclude } from "class-transformer";
import { IsEmail, IsString, MinLength } from "class-validator";
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { UserRole } from "../../../types/roles";
import { IUser } from "../../../types/user";
import { Activity } from "./activity";

@Entity()
export class User {
export class User implements IUser {
@PrimaryGeneratedColumn()
public id!: number;

Expand Down
3 changes: 3 additions & 0 deletions types/user.d.ts
@@ -0,0 +1,3 @@
export interface IUser {
email: string;
}

0 comments on commit 036b73f

Please sign in to comment.