We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6be61e5 commit 9552e65Copy full SHA for 9552e65
src/templates/routes.py.ejs
@@ -16,14 +16,16 @@ endpoints.forEach(function(endpoint) {
16
const path = endpoint.path
17
18
endpoint.methods.forEach(function(method) {
19
+ const hasGetOne = method.name === 'get'
20
+ const hasGetMany = method.name === 'get_list'
21
const pythonMethodName = generate_method_name(method.name, path)
22
const sql = formatQuery(method.query)
23
- if (method.name === 'get' || method.name === 'get_list') {
24
+ if (hasGetOne || hasGetMany) {
25
%>
26
@router.get('<%- path %>')
27
def <%- pythonMethodName %>():
-<% if (method.name === 'get') { -%>
28
+<% if (hasGetOne) { -%>
29
conn = psycopg2.connect(
30
database = os.getenv('DB_NAME'),
31
user = os.getenv('DB_USER'),
0 commit comments