# 为 user-chooser 组件添加一个附加参数，以便在结果中包含暂存用户

**URL:** <https://meta.discourse.org/t/add-an-additional-param-to-user-chooser-component-to-include-staged-users-in-the-results/186934>\
**Category:** Development\
**Created:** [2021 年4 月 15 日 10:43 UTC](https://meta.discourse.org/t/add-an-additional-param-to-user-chooser-component-to-include-staged-users-in-the-results/186934 "2021-04-15T10:43:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)\
发布日期： [2021 年4 月 15 日 10:43 UTC](https://meta.discourse.org/t/add-an-additional-param-to-user-chooser-component-to-include-staged-users-in-the-results/186934/1 "2021-04-15T10:43:43Z")

</div>

我们的一位客户需要一项功能，即通过下拉菜单选择用户，并且该下拉菜单应包含处于暂存状态的用户。

我已检查了代码库，发现该组件使用 `userSearch` 库方法来向服务器发起 API 调用。目前，该方法没有提供传递额外参数的途径。

此外，Rails 控制器动作 `search_users` 也没有任何机制来接收额外参数。

我打算提交一个 PR，允许向 `user-chooser` 组件传递一个名为 `includeStagedUsers` 的参数（默认值为 `false`），从而实现在下拉列表中显示暂存用户。@j.jaffeux 您怎么看？

---

_[View the full topic](https://meta.discourse.org/t/add-an-additional-param-to-user-chooser-component-to-include-staged-users-in-the-results/186934)._
