(@Param('field') field: string, @Param('value') value: string)
| 147 | |
| 148 | @Get('find/:field/:value') |
| 149 | async find(@Param('field') field: string, @Param('value') value: string) { |
| 150 | try { |
| 151 | const result = await this.userServices.checkIfUserExists({ |
| 152 | [field]: value, |
| 153 | }); |
| 154 | return new ServerResponse(201, 'Successfully searched user', { |
| 155 | exists: result, |
| 156 | }); |
| 157 | } catch (err: any) { |
| 158 | this.logger.error(`Failed to find user: ${err}`); |
| 159 | throw new HttpException(err?.code ?? err?.name ?? `${err}`, 400); |
| 160 | } |
| 161 | } |
| 162 | } |
nothing calls this directly
no test coverage detected