mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
UsersService: Add methods to find, create and delete users
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
ec8cf6d33e
commit
7997a0955a
3 changed files with 49 additions and 13 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue