Skip to content

Commit f0bf913

Browse files
author
hirsch88
committed
🐛 Some minor fixes
1 parent 155b88e commit f0bf913

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"protocol": "inspector",
1717
"env": {
18-
"NODE_ENV": "development"
18+
"NODE_ENV": "production"
1919
}
2020
}
2121
]

src/api/controllers/UserController.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
Authorized, Body, CurrentUser, Delete, Get, JsonController, OnUndefined, Param, Post, Put
2+
Authorized, Body, Delete, Get, JsonController, OnUndefined, Param, Post, Put, Req
33
} from 'routing-controllers';
44

55
import { UserNotFoundError } from '../errors/UserNotFoundError';
@@ -15,10 +15,15 @@ export class UserController {
1515
) { }
1616

1717
@Get()
18-
public find(@CurrentUser() user?: User): Promise<User[]> {
18+
public find(): Promise<User[]> {
1919
return this.userService.find();
2020
}
2121

22+
@Get('/me')
23+
public findMe(@Req() req: any): Promise<User[]> {
24+
return req.user;
25+
}
26+
2227
@Get('/:id')
2328
@OnUndefined(UserNotFoundError)
2429
public one(@Param('id') id: string): Promise<User | undefined> {

src/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { bootstrapMicroframework } from 'microframework-w3tec';
21
import 'reflect-metadata';
32

3+
import { bootstrapMicroframework } from 'microframework-w3tec';
4+
45
import { banner } from './lib/banner';
56
import { Logger } from './lib/logger';
67
import { eventDispatchLoader } from './loaders/eventDispatchLoader';

0 commit comments

Comments
 (0)