File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "hash" : " 69c67ab5" ,
3+ "configHash" : " 256baf21" ,
4+ "lockfileHash" : " 2bcb4725" ,
5+ "browserHash" : " 03db4624" ,
6+ "optimized" : {},
7+ "chunks" : {}
8+ }
Original file line number Diff line number Diff line change 1+ {
2+ "type" : " module"
3+ }
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ export class DocumentController {
4848 ) ;
4949 }
5050
51+ //find all....
52+ @Get ( )
53+ findAllDocs (
54+ @Req ( ) req : CustomRequest ,
55+ @Param ( 'workspaceId' ) workspaceId : string ,
56+ ) {
57+ return this . documentService . findAll ( req . user . userId , workspaceId ) ;
58+ }
59+
5160 @Patch ( ':documentId' )
5261 updateDocs (
5362 @Req ( ) req : CustomRequest ,
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ export class DocumentService {
3232 }
3333 return membership ;
3434 }
35+ private readonly safeUserSelect = {
36+ id : true ,
37+ name : true ,
38+ email : true ,
39+ role : true ,
40+ } ;
3541
3642 //create document under specified workspace..
3743 async createDocument (
@@ -48,7 +54,11 @@ export class DocumentService {
4854 workspace : { connect : { id : workspaceId } } ,
4955 createdBy : { connect : { id : userId } } ,
5056 } ,
51- include : { createdBy : true } ,
57+ include : {
58+ createdBy : {
59+ select : this . safeUserSelect ,
60+ } ,
61+ } ,
5262 } ) ;
5363 }
5464
@@ -61,7 +71,7 @@ export class DocumentService {
6171 id : documentId ,
6272 workspaceId : workspaceId ,
6373 } ,
64- include : { createdBy : true } ,
74+ include : { createdBy : { select : this . safeUserSelect } } ,
6575 } ) ;
6676
6777 if ( ! document ) {
@@ -81,7 +91,7 @@ export class DocumentService {
8191 orderBy : {
8292 updatedAt : 'desc' ,
8393 } ,
84- include : { createdBy : true } ,
94+ include : { createdBy : { select : this . safeUserSelect } } ,
8595 } ) ;
8696 }
8797
You can’t perform that action at this time.
0 commit comments