Skip to content

Commit

Permalink
Merge pull request #56 from richard483/fix-1
Browse files Browse the repository at this point in the history
added user info api
  • Loading branch information
richard483 authored Jan 16, 2024
2 parents dfba7b7 + 1168de5 commit 5355eac
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend-8tech",
"version": "4.0.7",
"version": "4.0.8",
"description": "",
"author": "8tech",
"private": true,
Expand Down
28 changes: 28 additions & 0 deletions src/users/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Body,
Controller,
Get,
Param,
Post,
Request,
Res,
Expand Down Expand Up @@ -104,6 +105,23 @@ export class UserController {
return response;
}

@ApiBearerAuth()
@UseInterceptors(FileInterceptor('file'))
@Roles(Role.USER, Role.RECRUITER)
@UseGuards(JwtAuthGuard, RoleGuard)
@Post('uploadCompanyProfilePicture')
async uploadCompanyProfilePicture(
@Request() req,
@UploadedFile() file: Express.Multer.File,
) {
console.log('#uploadCompanyProfilePicture user', req.user);
const response = await this.userService.uploadProfilePicture(
file,
req.user.companyId,
);
return response;
}

@ApiBearerAuth()
@ApiCookieAuth()
@Roles(Role.USER)
Expand All @@ -127,4 +145,14 @@ export class UserController {
);
return response;
}

@ApiBearerAuth()
@ApiCookieAuth()
@Roles(Role.USER)
@UseGuards(JwtAuthGuard, RoleGuard)
@Get('info/:id')
async getUserById(@Request() req, @Param() params) {
console.info('#UserGetProfileInfoById request incoming');
return await this.userService.findOneById(params.id);
}
}

0 comments on commit 5355eac

Please sign in to comment.