Пример #1
0
func addLeagueGameLinks(league *domain.League, c *gin.Context) {
	gamesURL := fmt.Sprintf("/api/leagues/%d/games", league.ID)
	league.AddLink(relGames, gamesURL)

	if isAuthenticated(c) {
		league.AddLink(relCreateGame, gamesURL)
	}
}
Пример #2
0
func addLeagueLinks(league *domain.League, c *gin.Context) {
	selfURL := fmt.Sprintf("/api/leagues/%d", league.ID)

	league.AddLink(domain.RelSelf, selfURL)

	if isAuthenticated(c) {
		league.AddLink(domain.RelUpdate, selfURL)
	}

	addLeagueGameLinks(league, c)
}