Skip to content

Commit 574fe28

Browse files
committed
chore(golang,js): don't fail on not yet supported aggregated_queries
Part of #17
1 parent 75e2091 commit 574fe28

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/templates/routes.go.ejs

+5
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ function dtoInCache(dto) {
143143
const verbs_with_dto = [ 'get', 'post', 'put' ]
144144
endpoints.forEach(function(endpoint) {
145145
const dtos = endpoint.methods
146+
.filter(method => method.query) // filter out aggregated_queries for a while (see #17)
146147
.filter(method => verbs_with_dto.includes(method.verb))
147148
.map(method => query2dto(sqlParser, method))
148149
.filter(elem => elem) // filter out nulls
@@ -161,6 +162,10 @@ endpoints.forEach(function(endpoint) {
161162
const path = convertPathPlaceholders(endpoint.path);
162163
163164
endpoint.methods.forEach(function(method) {
165+
if (!method.query) {
166+
// filter out aggregated_queries for a while (see #17)
167+
return
168+
}
164169
const params = extractParamsFromQuery(method.query);
165170
const hasGetOne = method.name === 'get';
166171
const hasGetMany = method.name === 'get_list';

src/templates/routes.js.ejs

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ endpoints.forEach(function(endpoint) {
55
const path = endpoint.path;
66
77
endpoint.methods.forEach(function(method) {
8+
if (!method.query) {
9+
// filter out aggregated_queries for a while (see #17)
10+
return
11+
}
812
const hasGetOne = method.name === 'get';
913
const hasGetMany = method.name === 'get_list';
1014
const sql = formatQuery(method.query);

0 commit comments

Comments
 (0)