Skip to content

Commit bc8fc72

Browse files
author
DylanBulmer
committed
add missing session property
1 parent 6d5c8d1 commit bc8fc72

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/entities/Session.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,29 @@ export class Session extends Base {
3131
os: string;
3232
browser: string;
3333
ipAddress: string;
34+
userId: Types.ObjectId;
3435
lastSeenAt: Date;
3536

3637
constructor({
3738
status = "INITIATING",
3839
os = "UNKNOWN",
3940
browser = "UNKNOWN",
4041
ipAddress = "UNKNOWN",
42+
userId,
4143
lastSeenAt,
4244
_id,
4345
__v,
4446
createdAt,
4547
updatedAt,
4648
createdBy,
4749
updatedBy,
48-
}: AtLeast<ISession, "createdBy">) {
50+
}: AtLeast<ISession, "createdBy" | "userId">) {
4951
super({ _id, __v, createdAt, updatedAt, createdBy, updatedBy });
5052
this.status = status;
5153
this.os = os;
5254
this.browser = browser;
5355
this.ipAddress = ipAddress;
56+
this.userId = userId;
5457
this.lastSeenAt = new Date(lastSeenAt || Date.now());
5558
}
5659

@@ -61,6 +64,7 @@ export class Session extends Base {
6164
os: this.os,
6265
browser: this.browser,
6366
ipAddress: this.ipAddress,
67+
userId: this.userId,
6468
lastSeenAt: this.lastSeenAt.toISOString(),
6569
...json,
6670
};

0 commit comments

Comments
 (0)