-
Notifications
You must be signed in to change notification settings - Fork 0
no unused route params
github-actions[bot] edited this page Apr 7, 2024
·
1 revision
💼 This rule is enabled in the following configs: 🌐 all
, ✅ recommended
.
💡 This rule is manually fixable by editor suggestions.
❌ Incorrect code:
@Controller("user")
class UserController {
@Get(":id")
getById() {}
@Put("details/:id")
putDetailsById() {}
@Post("other/:userId")
postOtherByUserId() {}
}
✅ Corrrect code:
@Controller("user")
class UserController {
@Get(":id")
getById(@Param("id") id: string) {}
@Put("details")
putDetails() {}
@Post("other/:userId")
postOtherByUserId(@Param() params: Record<string, string>) {}
}