Skip to content

Commit f2d72b2

Browse files
author
hirsch88
committed
update user model
1 parent 4cc45a7 commit f2d72b2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/api/models/User.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,38 @@ export class User extends Bookshelf.Model<User> {
1818
return await User.where<User>({ auth_0_user_id: userId }).fetch();
1919
}
2020

21+
/**
22+
* Configurations
23+
*/
2124
public get tableName(): string { return Tables.Users; }
2225
public get hasTimestamps(): boolean { return true; }
2326

27+
/**
28+
* Properties
29+
*/
2430
public get Id(): number { return this.get('id'); }
25-
public set Id(value: number) { this.set({ id: value }); }
31+
public set Id(value: number) { this.set('id', value); }
2632

2733
public get FirstName(): string { return this.get('firstName'); }
28-
public set FirstName(value: string) { this.set({ id: value }); }
34+
public set FirstName(value: string) { this.set('firstName', value); }
2935

3036
public get LastName(): string { return this.get('lastName'); }
31-
public set LastName(value: string) { this.set({ id: value }); }
37+
public set LastName(value: string) { this.set('lastName', value); }
3238

3339
public get Email(): string { return this.get('email'); }
34-
public set Email(value: string) { this.set({ id: value }); }
40+
public set Email(value: string) { this.set('email', value); }
41+
42+
public get Picture(): string { return this.get('picture'); }
43+
public set Picture(value: string) { this.set('picture', value); }
44+
45+
public get Auth0UserId(): string { return this.get('auth0UserId'); }
46+
public set Auth0UserId(value: string) { this.set('auth0UserId', value); }
3547

3648
public get UpdatedAt(): Date { return this.get('updatedAt'); }
37-
public set UpdatedAt(value: Date) { this.set({ id: value }); }
49+
public set UpdatedAt(value: Date) { this.set('updatedAt', value); }
3850

3951
public get CreatedAt(): Date { return this.get('createdAt'); }
40-
public set CreatedAt(value: Date) { this.set({ id: value }); }
52+
public set CreatedAt(value: Date) { this.set('createdAt', value); }
4153

4254
public fullName(): string {
4355
return this.FirstName + ' ' + this.LastName;

0 commit comments

Comments
 (0)