Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): createRequestParamDecorator default support throw error #3656

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/decorator/web/paramMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export const createRequestParamDecorator = function (
pipes: pipesOrOptions as Array<PipeUnionTransform>,
};
}
if (pipesOrOptions.throwError == null) pipesOrOptions.throwError = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里还是 breaking 了,可以合到 4.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的,先发你之前的小Patch吧


return createParamMapping(RouteParamTypes.CUSTOM)(transform, pipesOrOptions);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`/test/web/paramMapping.test.ts paramMapping decorator should be ok 1`]
"pipes": [
[Function],
],
"throwError": true,
},
"parameterIndex": 9,
"propertyName": "doget",
Expand Down
Loading