File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,24 @@ export class ClientController {
3636 } )
3737 }
3838
39- @Get ( '/documents ' )
39+ @Get ( '/document ' )
4040 @UseGuards ( AuthGuard )
4141 async findAllDocumentsByClient ( @Req ( ) request : UserRequest ) {
4242 return await this . documentService . findAll ( { clientId : request . user . sub } )
4343 }
4444
45+ @Get ( '/document/:id' )
46+ @UseGuards ( AuthGuard )
47+ async findOneDocumentByClient (
48+ @Param ( 'id' ) id : string ,
49+ @Req ( ) request : UserRequest ,
50+ ) {
51+ return await this . documentService . findAll ( {
52+ id : id ,
53+ clientId : request . user . sub ,
54+ } )
55+ }
56+
4557 @Get ( )
4658 findAll ( ) {
4759 return this . clientService . findAll ( )
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ export class DocumentService {
3737 return await this . create ( createDocumentDto )
3838 }
3939
40- async findAll ( data : any ) {
41- return await this . documentRepository . documents ( { where : data } )
40+ async findAll ( params : any ) {
41+ return await this . documentRepository . documents ( { where : params } )
4242 }
4343
4444 async findOne ( id : string ) {
You can’t perform that action at this time.
0 commit comments