Skip to content

Commit

Permalink
argument index fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iyobo committed Apr 28, 2021
1 parent d26601f commit e945346
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/generateRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ async function _determineArgument(
if (result && injectOptions) {
result = result[injectOptions];
}

//TODO: implement custom function capability here for arg injectors
}

// validate if this is a class
// validate if this is a class. If it is a class, validate it
if (result && isClass(type)) {
result = await plainToClass(type, result);

Expand Down Expand Up @@ -183,11 +185,13 @@ async function _generateEndPoints(
for (const index of Object.keys(action.arguments)) {
const argumentMeta = action.arguments[index];

targetArguments[index] = await _determineArgument(
const numIndex = Number(index)

targetArguments[numIndex] = await _determineArgument(
ctx,
index,
argumentMeta,
action.argumentTypes[index],
action.argumentTypes[numIndex],
options
);
}
Expand Down

0 comments on commit e945346

Please sign in to comment.