SE-TINF22B2 / G5-DuoGradus

Sammle Schritte, Tritt gegen Freunde an und steig in deiner Liga auf!
https://docs.duo-gradus.de
Apache License 2.0
3 stars 1 forks source link

Endpoint for registering new users #231

Closed OG-NI closed 3 months ago

OG-NI commented 3 months ago

What this PR does/why we need it?: This adds an API endpoint for registering new users.

Which Issues does this PR fix?: Fixes #207

OG-NI commented 3 months ago

Not sure if this is a problem if enabled is not specified:

public async createUser(
    email: string,
    displayName: string,
    password: string,
    enabled?: boolean,
  ): Promise<User> {
    return await this.prisma.user.create({
      data: {
        email,
        displayName,
        password,
        enabled,
      },
    });
  }