Skip to content

Commit

Permalink
preload roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed May 27, 2024
1 parent 3647704 commit 48728de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/database/models/roster.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func GetRosters() ([]Roster, error) {

func GetRostersByCID(cid uint) ([]Roster, error) {
var rosters []Roster
return rosters, database.DB.Where("c_id = ?", cid).Find(&rosters).Error
return rosters, database.DB.Where("c_id = ?", cid).Preload("Roles").Find(&rosters).Error
}

func GetRostersByFacility(facility constants.FacilityID) ([]Roster, error) {
Expand Down

0 comments on commit 48728de

Please sign in to comment.