Skip to content

Commit

Permalink
fix: return team by slug
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed Jun 17, 2024
1 parent 3ee7e87 commit 6c703ad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions adapters/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ type GothUser struct {
DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

// TeamBySlug is returning the team with the given ID.
func (u *GothUser) TeamBySlug(slug string) *GothTeam {
for _, team := range *u.Teams {
if team.Slug == slug {
return &team
}
}

return nil
}

// GothSession is a session for a user.
type GothSession struct {
// ID is the unique identifier of the session.
Expand Down

0 comments on commit 6c703ad

Please sign in to comment.