fix: remove user_ids validation that blocked notes-to-self
The 'at least one user_id is required' check ran before the creator
was added to memberSet, so {user_ids: []} always 400'd. Now empty
user_ids is allowed — the creator is always in memberSet.
This commit is contained in:
@@ -70,10 +70,7 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, `{"error":"invalid request"}`, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if len(req.UserIDs) == 0 {
|
||||
http.Error(w, `{"error":"at least one user_id is required"}`, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
// ponytail: user_ids can be empty for self-DM (notes to self)
|
||||
|
||||
// Build unique member set including creator.
|
||||
memberSet := map[string]struct{}{userID: {}}
|
||||
|
||||
Reference in New Issue
Block a user