teams: cleanup.

This commit is contained in:
Leonard Gram
2019-03-19 14:01:16 +01:00
parent fc0461134f
commit ccfd6789ca
3 changed files with 12 additions and 12 deletions
+9 -9
View File
@@ -64,13 +64,13 @@ type GetTeamMembersQuery struct {
// Projections and DTOs
type TeamMemberDTO struct {
OrgId int64 `json:"orgId"`
TeamId int64 `json:"teamId"`
UserId int64 `json:"userId"`
External bool `json:"-"`
Email string `json:"email"`
Login string `json:"login"`
AvatarUrl string `json:"avatarUrl"`
Labels []string `json:"labels"`
Permission int64 `json:"permission"`
OrgId int64 `json:"orgId"`
TeamId int64 `json:"teamId"`
UserId int64 `json:"userId"`
External bool `json:"-"`
Email string `json:"email"`
Login string `json:"login"`
AvatarUrl string `json:"avatarUrl"`
Labels []string `json:"labels"`
Permission PermissionType `json:"permission"`
}
+1 -1
View File
@@ -25,7 +25,7 @@ func CanAdmin(orgId int64, teamId int64, user *m.SignedInUser) error {
}
for _, member := range cmd.Result {
if member.UserId == user.UserId && member.Permission == int64(m.PERMISSION_ADMIN) {
if member.UserId == user.UserId && member.Permission == m.PERMISSION_ADMIN {
return nil
}
}
+2 -2
View File
@@ -45,7 +45,7 @@ func TestUpdateTeam(t *testing.T) {
OrgId: testTeam.OrgId,
TeamId: testTeam.Id,
UserId: editor.UserId,
Permission: int64(m.PERMISSION_ADMIN),
Permission: m.PERMISSION_ADMIN,
}}
return nil
})
@@ -67,7 +67,7 @@ func TestUpdateTeam(t *testing.T) {
OrgId: testTeamOtherOrg.OrgId,
TeamId: testTeamOtherOrg.Id,
UserId: editor.UserId,
Permission: int64(m.PERMISSION_ADMIN),
Permission: m.PERMISSION_ADMIN,
}}
return nil
})