UsersService: Add methods to find, create and delete users

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-10-12 21:46:53 +02:00
parent ec8cf6d33e
commit 7997a0955a
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 49 additions and 13 deletions

View file

@ -48,4 +48,20 @@ export class User {
identity => identity.user,
)
identities: Identity[];
// eslint-disable-next-line @typescript-eslint/no-empty-function
private constructor() {}
public static create(
userName: string,
displayName: string,
): Pick<
User,
'userName' | 'displayName' | 'ownedNotes' | 'authToken' | 'identities'
> {
const newUser = new User();
newUser.userName = userName;
newUser.displayName = displayName;
return newUser;
}
}