Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1258902

Browse files
authored
chore: update error message for duplicate organization members (#17594)
Closescoder/internal#345
1 parenta78f0fc commit1258902

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
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
ifdatabase.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
}

‎coderd/members_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAddMember(t *testing.T) {
2626
// Add user to org, even though they already exist
2727
// nolint:gocritic // must be an owner to see the user
2828
_,err:=owner.PostOrganizationMember(ctx,first.OrganizationID,user.Username)
29-
require.ErrorContains(t,err,"alreadyexists")
29+
require.ErrorContains(t,err,"alreadyan organization member")
3030
})
3131
}
3232

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp