Skip to content

Commit 06f48b0

Browse files
committed
refactor: rename method
1 parent 08cb820 commit 06f48b0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const createEndpoints = async (destDir, lang, config) => {
162162
"endpoints": config,
163163

164164
// "... WHERE id = :p.id" => [ "p.id" ]
165-
"extractParams": (query) => query.match(/(?<=:)[pb]\.\w+/g) || [],
165+
"extractParamsFromQuery": (query) => query.match(/(?<=:)[pb]\.\w+/g) || [],
166166

167167
// [ "p.page", "b.num" ] => '"page": req.params.page, "num": req.body.num'
168168
// (used only with Express)

src/templates/routes.go.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ endpoints.forEach(function(endpoint) {
161161
const path = convertPathPlaceholders(endpoint.path);
162162
163163
endpoint.methods.forEach(function(method) {
164-
const params = extractParams(method.query);
164+
const params = extractParamsFromQuery(method.query);
165165
const hasGetOne = method.name === 'get';
166166
const hasGetMany = method.name === 'get_list';
167167
if (hasGetOne || hasGetMany) {

src/templates/routes.js.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endpoints.forEach(function(endpoint) {
88
const hasGetOne = method.name === 'get';
99
const hasGetMany = method.name === 'get_list';
1010
const sql = formatQuery(method.query);
11-
const params = extractParams(method.query);
11+
const params = extractParamsFromQuery(method.query);
1212
const formattedParams = params.length > 0
1313
? '\n { ' + formatParamsAsJavaScriptObject(params) + ' },'
1414
: ''

0 commit comments

Comments
 (0)