Skip to content

Commit

Permalink
refactor: default to None
Browse files Browse the repository at this point in the history
reduce the total diff of this change
  • Loading branch information
mxdvl committed Jun 13, 2024
1 parent 3a59418 commit b2e8097
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions sport/app/football/controllers/FixturesController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class FixturesController(

private def renderAllFixtures(date: LocalDate): Action[AnyContent] =
Action { implicit request =>
renderMatchList(page, fixtures(date), filters, None)
renderMatchList(page, fixtures(date), filters)
}

private def renderMoreFixtures(fixtures: Fixtures): Action[AnyContent] =
Action { implicit request =>
renderMoreMatches(page, fixtures, filters, None)
renderMoreMatches(page, fixtures, filters)
}

def moreTagFixturesForJson(year: String, month: String, day: String, tag: String): Action[AnyContent] =
Expand Down
8 changes: 3 additions & 5 deletions sport/app/football/controllers/LeagueTableController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ case class TablesPage(
urlBase: String,
filters: Map[String, Seq[CompetitionFilter]] = Map.empty,
comp: Option[Competition],
atom: Option[InteractiveAtom],
atom: Option[InteractiveAtom] = None,
) {
lazy val singleCompetition = tables.size == 1
}
Expand Down Expand Up @@ -111,12 +111,11 @@ class LeagueTableController(
val comps = competitionsService.competitions.filter(_.showInTeamsList).filter(_.hasTeams)

val htmlResponse =
() =>
football.views.html.teamlist(TablesPage(page, groups, "/football", filters(tableOrder), None, None), comps)
() => football.views.html.teamlist(TablesPage(page, groups, "/football", filters(tableOrder), None), comps)
val jsonResponse =
() =>
football.views.html.fragments
.teamlistBody(TablesPage(page, groups, "/football", filters(tableOrder), None, None), comps)
.teamlistBody(TablesPage(page, groups, "/football", filters(tableOrder), None), comps)
renderFormat(htmlResponse, jsonResponse, page, Switches.all)

}
Expand Down Expand Up @@ -211,7 +210,6 @@ class LeagueTableController(
table.competition.url,
filters(tableOrder),
Some(table.competition),
None,
),
)
val jsonResponse = () =>
Expand Down
4 changes: 2 additions & 2 deletions sport/app/football/controllers/MatchListController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ trait MatchListController extends BaseController with Requests {
page: FootballPage,
matchesList: MatchesList,
filters: Map[String, Seq[CompetitionFilter]],
atom: Option[InteractiveAtom],
atom: Option[InteractiveAtom] = None,
)(implicit request: RequestHeader, context: ApplicationContext) = {
Cached(10) {
if (request.isJson)
Expand All @@ -45,7 +45,7 @@ trait MatchListController extends BaseController with Requests {
page: FootballPage,
matchesList: MatchesList,
filters: Map[String, Seq[CompetitionFilter]],
atom: Option[InteractiveAtom],
atom: Option[InteractiveAtom] = None,
)(implicit request: RequestHeader, context: ApplicationContext) = {
Cached(10) {
if (request.isJson)
Expand Down

0 comments on commit b2e8097

Please sign in to comment.