8000 Require at least one arg in route def · aa10000/arangodb@f2a6864 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2a6864

Browse files
committed
Require at least one arg in route def
1 parent 5c868d0 commit f2a6864

File tree

1 file changed

+2
-2
lines changed
  • js/server/modules/@arangodb/foxx/router

1 file changed

+2
-2
lines changed

js/server/modules/@arangodb/foxx/router/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Router = module.exports =
106106
[['path', 'string'], ...repeat(Math.max(1, args.length - 2), ['handler', 'function']), ['name', 'string']],
107107
[['path', 'string'], ...repeat(Math.max(1, args.length - 1), ['handler', 'function'])],
108108
[...repeat(Math.max(1, args.length - 1), ['handler', 'function']), ['name', 'string']],
109-
repeat(args.length, ['handler', 'function'])
109+
repeat(Math.max(1, args.length - 1), ['handler', 'function'])
110110
);
111111
const path = argv.path;
112112
const handler = argv.handler;
@@ -130,7 +130,7 @@ ALL_METHODS.forEach(function (method) {
130130
[['path', 'string'], ...repeat(Math.max(1, args.length - 2), ['handler', 'function']), ['name', 'string']],
131131
[['path', 'string'], ...repeat(Math.max(1, args.length - 1), ['handler', 'function'])],
132132
[...repeat(Math.max(1, args.length - 1), ['handler', 'function']), ['name', 'string']],
133-
repeat(args.length, ['handler', 'function'])
133+
repeat(Math.max(1, args.length - 1), ['handler', 'function'])
134134
);
135135
const path = argv.path;
136136
const handler = argv.handler;

0 commit comments

Comments
 (0)
0