Skip to content

Commit 890073b

Browse files
committed
refactor: rename a function
1 parent 856eb99 commit 890073b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const createEndpoints = async (destDir, lang, config) => {
121121

122122
// [ "p.page", "b.num" ] => '{ "page" : req.params.page, "num": req.body.num }'
123123
// (used only with Express)
124-
"formatParams": (params) => {
124+
"formatParamsAsJavaScriptObject": (params) => {
125125
return params.length > 0
126126
? '{ ' + Array.from(new Set(params), p => `"${p.substring(2)}": ${placeholdersMap[p.substring(0, 1)]}.${p.substring(2)}`).join(', ') + ' }'
127127
: params;

src/templates/routes.js.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endpoints.forEach(function(endpoint) {
1010
const sql = formatQuery(method.query);
1111
const params = extractParams(method.query);
1212
const formattedParams = params.length > 0
13-
? '\n ' + formatParams(params) + ','
13+
? '\n ' + formatParamsAsJavaScriptObject(params) + ','
1414
: ''
1515
1616
if (hasGetOne || hasGetMany) {

0 commit comments

Comments
 (0)