mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
23 lines
696 B
TypeScript
23 lines
696 B
TypeScript
import { Controller, Get, Query } from "@nestjs/common";
|
|
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
|
import { Public } from "@edr/api-common";
|
|
|
|
import { CheckAvailabilityService } from "./check-availability.service";
|
|
|
|
@ApiTags("auth")
|
|
@Controller("auth")
|
|
@Public()
|
|
export class CheckAvailabilityController {
|
|
constructor(
|
|
private readonly checkAvailabilityService: CheckAvailabilityService,
|
|
) {}
|
|
|
|
@Get("check-availability")
|
|
@ApiOperation({
|
|
summary: "Check whether an email and/or phone number is already registered",
|
|
})
|
|
check(@Query("email") email?: string, @Query("phone") phone?: string) {
|
|
return this.checkAvailabilityService.check({ email, phone });
|
|
}
|
|
}
|