Skip to content

Commit 159663a

Browse files
committed
refactor: treat a sinqle query as a list with one element
Part of #17
1 parent beb9e8b commit 159663a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cli.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,17 @@ const createEndpoints = async (destDir, lang, config) => {
132132
path = convertPathPlaceholders(path)
133133
}
134134
endpoint.methods.forEach(method => {
135-
const sql = removePlaceholders(flattenQuery(method.query));
136135
const verb = method.verb.toUpperCase();
136+
console.log(`${verb} ${path}`);
137137

138-
console.log(`${verb} ${path}\n\t${sql}`);
138+
let queries = []
139+
if (method.query) {
140+
queries.push(method.query)
141+
}
142+
queries.forEach(query => {
143+
const sql = removePlaceholders(flattenQuery(query));
144+
console.log(`\t${sql}`);
145+
})
139146
});
140147
}
141148

0 commit comments

Comments
 (0)