Skip to content

Commit 33082af

Browse files
committed
SeriesController.addSellersToModel(): extract method.
Prereqisite for #695 No functional changes.
1 parent c153909 commit 33082af

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/ru/mystamps/web/controller/SeriesController.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ protected void addYearToModel(Model model) {
506506
model.addAttribute("years", YEARS);
507507
}
508508

509+
protected void addSellersToModel(Model model) {
510+
List<EntityWithParentDto> sellers = transactionParticipantService.findSellersWithParents();
511+
List<SelectItem> groupedSellers = GroupByParent.transformEntities(sellers);
512+
model.addAttribute("sellers", groupedSellers);
513+
}
514+
509515
protected static void loadErrorsFromDownloadInterceptor(
510516
NullableImageUrl form,
511517
BindingResult result,
@@ -604,9 +610,7 @@ private void addSeriesSalesFormToModel(Model model) {
604610
model.addAttribute("addSeriesSalesForm", addSeriesSalesForm);
605611
}
606612

607-
List<EntityWithParentDto> sellers = transactionParticipantService.findSellersWithParents();
608-
List<SelectItem> groupedSellers = GroupByParent.transformEntities(sellers);
609-
model.addAttribute("sellers", groupedSellers);
613+
addSellersToModel(model);
610614

611615
List<EntityWithParentDto> buyers = transactionParticipantService.findBuyersWithParents();
612616
List<SelectItem> groupedBuyers = GroupByParent.transformEntities(buyers);

0 commit comments

Comments
 (0)