Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 519c1ed

Browse files
committed
chore: update error message for duplicate organization members
1 parent df47c30 commit 519c1ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coderd/members.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ func (api *API) postOrganizationMember(rw http.ResponseWriter, r *http.Request)
6262
}
6363
if database.IsUniqueViolation(err, database.UniqueOrganizationMembersPkey) {
6464
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
65-
Message: "Organization member already exists in this organization",
65+
Message: "User is already an organization member",
66+
Detail: fmt.Sprintf("%s is already a member of %s", user.Username, organization.DisplayName),
6667
})
6768
return
6869
}

0 commit comments

Comments
 (0)