# 尝试通过 API (PUT groups/{id}.json) 更新群组监视列表时出错

**URL:** <https://meta.discourse.org/t/error-when-trying-to-update-the-watchlist-for-a-group-via-api-put-groups-id-json/393572>\
**Category:** Bug\
**Tags:** groups, rest-api\
**Created:** [2026年一月15日 18:19 UTC](https://meta.discourse.org/t/error-when-trying-to-update-the-watchlist-for-a-group-via-api-put-groups-id-json/393572 "2026-01-15T18:19:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2026年一月16日 18:26 UTC](https://meta.discourse.org/t/error-when-trying-to-update-the-watchlist-for-a-group-via-api-put-groups-id-json/393572/3 "2026-01-16T18:26:55Z")

</div>

是的，那个端点有点奇怪。我们想提醒工作人员可能受影响的用户数量，并让他们选择是追溯性地应用更改还是不应用。

这就是您在服务器响应中看到“`{ 'user_count': 2, ... }`”的原因。

我已经澄清了错误消息，使其更有意义，并改进了前端代码以更好地处理此“用例”，同时添加了规范。

> <https://github.com/discourse/discourse/pull/37184>
>
> When updating a group's notification defaults (like watching\_category\_ids) via A…PI, if existing members would be affected, the server returns a 422 asking the caller to specify whether to apply changes to existing users.
> 
> The previous error message was confusing: "You supplied invalid parameters to the request: update\_existing\_users" - even though the caller hadn't supplied that parameter at all. The new message clearly explains what's happening and what to do:
> 
> "This change affects X existing group members. You must specify the 'update\_existing\_users' parameter (true or false) to indicate whether to apply the new notification defaults to existing members."
> 
> Also fixed a bug where the confirmation modal state wasn't being reset when navigating between groups, causing the modal to not appear on subsequent group edits. The modal now returns its result directly instead of storing it in component state.
> 
> Ref - https://meta.discourse.org/t/-/393572

---

_[View the full topic](https://meta.discourse.org/t/error-when-trying-to-update-the-watchlist-for-a-group-via-api-put-groups-id-json/393572)._
