Fix/bulk invite api error response (#6247)

This commit is contained in:
Vishal Sharma 2024-10-23 23:43:46 +05:30 committed by GitHub
parent 910c44cefc
commit 0e2b67059b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1993,7 +1993,7 @@ func (aH *APIHandler) inviteUsers(w http.ResponseWriter, r *http.Request) {
}
// Check the response status and set the appropriate HTTP status code
if response.Status == "failure" {
w.WriteHeader(http.StatusInternalServerError)
w.WriteHeader(http.StatusBadRequest) // 400 Bad Request for failure
} else if response.Status == "partial_success" {
w.WriteHeader(http.StatusPartialContent) // 206 Partial Content
} else {