From b2e809720331faf150075a12c2847339cdc37089 Mon Sep 17 00:00:00 2001 From: Max Duval Date: Thu, 13 Jun 2024 15:31:22 +0100 Subject: [PATCH] refactor: default to None reduce the total diff of this change --- sport/app/football/controllers/FixturesController.scala | 4 ++-- .../app/football/controllers/LeagueTableController.scala | 8 +++----- sport/app/football/controllers/MatchListController.scala | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sport/app/football/controllers/FixturesController.scala b/sport/app/football/controllers/FixturesController.scala index 969815484154..c960a9f756e0 100644 --- a/sport/app/football/controllers/FixturesController.scala +++ b/sport/app/football/controllers/FixturesController.scala @@ -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] = diff --git a/sport/app/football/controllers/LeagueTableController.scala b/sport/app/football/controllers/LeagueTableController.scala index c37deea07c51..c88dc030b2aa 100644 --- a/sport/app/football/controllers/LeagueTableController.scala +++ b/sport/app/football/controllers/LeagueTableController.scala @@ -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 } @@ -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) } @@ -211,7 +210,6 @@ class LeagueTableController( table.competition.url, filters(tableOrder), Some(table.competition), - None, ), ) val jsonResponse = () => diff --git a/sport/app/football/controllers/MatchListController.scala b/sport/app/football/controllers/MatchListController.scala index 79aeb04233d8..38f5f714a50e 100644 --- a/sport/app/football/controllers/MatchListController.scala +++ b/sport/app/football/controllers/MatchListController.scala @@ -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) @@ -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)