@@ -45,6 +45,7 @@ export class NodeController {
4545 @HttpCode ( HttpStatus . OK )
4646 async getNodeById ( @Param ( 'id' , ParseIntPipe ) id : number ) {
4747 const node = await this . nodeService . findNodeById ( id ) ;
48+
4849 return {
4950 message : NodeResponseMessage . NODE_RETURNED ,
5051 node : node ,
@@ -59,6 +60,7 @@ export class NodeController {
5960 @HttpCode ( HttpStatus . CREATED )
6061 async createNode ( @Body ( ) body : CreateNodeDto ) {
6162 await this . nodeService . createNode ( body ) ;
63+
6264 return {
6365 message : NodeResponseMessage . NODE_CREATED ,
6466 } ;
@@ -76,6 +78,7 @@ export class NodeController {
7678 @Param ( 'id' , ParseIntPipe ) id : number ,
7779 ) : Promise < { message : string } > {
7880 await this . nodeService . deleteNode ( id ) ;
81+
7982 return {
8083 message : NodeResponseMessage . NODE_DELETED ,
8184 } ;
@@ -92,6 +95,7 @@ export class NodeController {
9295 @Body ( ) body : UpdateNodeDto ,
9396 ) : Promise < { message : string } > {
9497 await this . nodeService . updateNode ( id , body ) ;
98+
9599 return {
96100 message : NodeResponseMessage . NODE_UPDATED ,
97101 } ;
@@ -105,6 +109,7 @@ export class NodeController {
105109 @HttpCode ( HttpStatus . OK )
106110 async getCoordinates ( @Param ( 'id' , ParseIntPipe ) id : number ) {
107111 const coordinate = await this . nodeService . getCoordinates ( id ) ;
112+
108113 return {
109114 message : NodeResponseMessage . NODE_GET_COORDINAE ,
110115 coordinate : coordinate ,
@@ -118,6 +123,7 @@ export class NodeController {
118123 @Body ( ) body : MoveNodeDto ,
119124 ) {
120125 await this . nodeService . moveNode ( id , body ) ;
126+
121127 return {
122128 message : NodeResponseMessage . NODE_MOVED ,
123129 } ;
@@ -133,6 +139,7 @@ export class NodeController {
133139 @Param ( 'workspaceId' ) workspaceId : string , // Snowflake ID
134140 ) : Promise < FindNodesResponseDto > {
135141 const nodes = await this . nodeService . findNodesByWorkspace ( workspaceId ) ;
142+
136143 return {
137144 message : NodeResponseMessage . NODES_RETURNED ,
138145 nodes,
0 commit comments