diff options
author | Joe Chen <jc@unknwon.io> | 2022-11-05 13:12:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 13:12:53 +0800 |
commit | a66c90462da24a916ee62afcb5a1f79d06ed8399 (patch) | |
tree | ac193502864d4f9309e82adf2b883f2d6cdfe879 /internal/db/user.go | |
parent | 3af5a424f0e1afa9e77a60376bca97bc5c3b5f8b (diff) |
refactor(db): migrate methods off `user.go` and `org.go` (#7219) (#7227)
Diffstat (limited to 'internal/db/user.go')
-rw-r--r-- | internal/db/user.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/internal/db/user.go b/internal/db/user.go index ea947224..a5e4d65c 100644 --- a/internal/db/user.go +++ b/internal/db/user.go @@ -60,23 +60,6 @@ func (u *User) getOrganizationCount(e Engine) (int64, error) { return e.Where("uid=?", u.ID).Count(new(OrgUser)) } -// GetOrganizations returns all organizations that user belongs to. -func (u *User) GetOrganizations(showPrivate bool) error { - orgIDs, err := GetOrgIDsByUserID(u.ID, showPrivate) - if err != nil { - return fmt.Errorf("GetOrgIDsByUserID: %v", err) - } - if len(orgIDs) == 0 { - return nil - } - - u.Orgs = make([]*User, 0, len(orgIDs)) - if err = x.Where("type = ?", UserTypeOrganization).In("id", orgIDs).Find(&u.Orgs); err != nil { - return err - } - return nil -} - // IsUserExist checks if given user name exist, // the user name should be noncased unique. // If uid is presented, then check will rule out that one, |