File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -211,22 +211,21 @@ endpoints.forEach(function(endpoint) {
211
211
let methodArgs
212
212
let sql
213
213
let formattedParams
214
+ let model
214
215
if (method .name === ' post' || method .name === ' put' || method .name === ' delete' ) {
215
216
sql = convertToPsycopgNamedArguments (formatQueryForPython (method .query , 20 ))
216
217
const params = extractParamsFromQuery (method .query )
217
218
formattedParams = formatParamsAsPythonDict (params)
218
- }
219
219
220
- let model
221
- if (method .name === ' post' || method .name === ' put' ) {
222
- const dto = query2dto (sqlParser, method)
223
- // LATER: do we really need signature and cache?
224
- model = obtainDtoName (dto)
225
- methodArgs = [ ` body: ${ model} ` , ... argsFromPath, ' conn=Depends(db_connection)' ]
226
- }
220
+ if (method .name === ' post' || method .name === ' put' ) {
221
+ const dto = query2dto (sqlParser, method)
222
+ // LATER: do we really need signature and cache?
223
+ model = obtainDtoName (dto)
224
+ methodArgs = [ ` body: ${ model} ` , ... argsFromPath, ' conn=Depends(db_connection)' ]
227
225
228
- if (method .name === ' delete' ) {
229
- methodArgs = [ ... argsFromPath, ' conn=Depends(db_connection)' ]
226
+ } else if (method .name === ' delete' ) {
227
+ methodArgs = [ ... argsFromPath, ' conn=Depends(db_connection)' ]
228
+ }
230
229
}
231
230
232
231
if (hasGetOne || hasGetMany) {
You can’t perform that action at this time.
0 commit comments