File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 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) {
211211 let methodArgs
212212 let sql
213213 let formattedParams
214+ let model
214215 if (method .name === ' post' || method .name === ' put' || method .name === ' delete' ) {
215216 sql = convertToPsycopgNamedArguments (formatQueryForPython (method .query , 20 ))
216217 const params = extractParamsFromQuery (method .query )
217218 formattedParams = formatParamsAsPythonDict (params)
218- }
219219
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)' ]
227225
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+ }
230229 }
231230
232231 if (hasGetOne || hasGetMany) {
You can’t perform that action at this time.
0 commit comments