user read

This commit is contained in:
2022-10-14 19:18:28 +02:00
parent 5538a042df
commit b2024bf4aa
5 changed files with 42 additions and 13 deletions

View File

@ -1,5 +1,5 @@
import { Collection, Db } from 'mongodb';
import { User } from '../../entities/user';
import { User, UserWithPassword } from '../../entities/user';
class UserModel {
private collection: Collection<User>;
@ -8,7 +8,7 @@ class UserModel {
this.collection = db.collection<User>('users');
}
public async create(tracker: string, user: User) {
public async create(tracker: string, user: UserWithPassword) {
await this.collection.insertOne(user);
return this.read(tracker, user.uuid);
}