File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
examples/express-composition/src/controllers Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
del ,
15
15
get ,
16
16
getFilterSchemaFor ,
17
+ getModelSchemaRef ,
17
18
getWhereSchemaFor ,
18
19
param ,
19
20
patch ,
@@ -84,7 +85,14 @@ export class NoteController {
84
85
} ,
85
86
} )
86
87
async updateAll (
87
- @requestBody ( ) note : Note ,
88
+ @requestBody ( {
89
+ content : {
90
+ 'application/json' : {
91
+ schema : getModelSchemaRef ( Note , { partial : true } ) ,
92
+ } ,
93
+ } ,
94
+ } )
95
+ note : Partial < Note > ,
88
96
@param . query . object ( 'where' , getWhereSchemaFor ( Note ) ) where ?: Where < Note > ,
89
97
) : Promise < Count > {
90
98
return await this . noteRepository . updateAll ( note , where ) ;
@@ -111,7 +119,14 @@ export class NoteController {
111
119
} )
112
120
async updateById (
113
121
@param . path . number ( 'id' ) id : number ,
114
- @requestBody ( ) note : Note ,
122
+ @requestBody ( {
123
+ content : {
124
+ 'application/json' : {
125
+ schema : getModelSchemaRef ( Note , { partial : true } ) ,
126
+ } ,
127
+ } ,
128
+ } )
129
+ note : Partial < Note > ,
115
130
) : Promise < void > {
116
131
await this . noteRepository . updateById ( id , note ) ;
117
132
}
You can’t perform that action at this time.
0 commit comments