Skip to content

Commit 24b0a93

Browse files
committed
Load task lists progressively
1 parent 26ea258 commit 24b0a93

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/code_corps_web/controllers/task_controller.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ defmodule CodeCorpsWeb.TaskController do
6262
end
6363
end
6464

65-
@preloads [:comments, :github_pull_request, :task_skills, :user_task]
65+
@preloads [:comments, :github_pull_request, :task_skills, :user, [user_task: :user]]
6666

6767
def preload(data) do
6868
timing("TaskController", "preload") do

lib/code_corps_web/views/project_view.ex

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ defmodule CodeCorpsWeb.ProjectView do
1414
:total_monthly_donated, :updated_at, :website
1515
]
1616

17-
has_one :organization, serializer: CodeCorpsWeb.OrganizationView, include: true
17+
has_one :organization, type: "organization", field: :organization_id
1818
has_one :stripe_connect_plan, serializer: CodeCorpsWeb.StripeConnectPlanView
1919

2020
has_many :donation_goals, serializer: CodeCorpsWeb.DonationGoalView, identifiers: :always
21-
has_many :project_categories, serializer: CodeCorpsWeb.ProjectCategoryView, include: true
21+
has_many :project_categories, serializer: CodeCorpsWeb.ProjectCategoryView, identifiers: :always
2222
has_many :project_github_repos, serializer: CodeCorpsWeb.ProjectGithubRepoView, identifiers: :always
23-
has_many :project_skills, serializer: CodeCorpsWeb.ProjectSkillView, include: true
24-
has_many :project_users, serializer: CodeCorpsWeb.ProjectUserView, include: true
23+
has_many :project_skills, serializer: CodeCorpsWeb.ProjectSkillView, identifiers: :always
24+
has_many :project_users, serializer: CodeCorpsWeb.ProjectUserView, identifiers: :always
25+
has_many :tasks, serializer: CodeCorpsWeb.TaskView, identifiers: :always
2526
has_many :task_lists, serializer: CodeCorpsWeb.TaskListView, identifiers: :always
2627

2728
def can_activate_donations(project, _conn) do

lib/code_corps_web/views/task_list_view.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ defmodule CodeCorpsWeb.TaskListView do
77

88
has_one :project, type: "project", field: :project_id
99

10-
has_many :tasks, serializer: CodeCorpsWeb.TaskInListView, include: true
10+
has_many :tasks, serializer: CodeCorpsWeb.TaskView, identifiers: :always
1111
end

0 commit comments

Comments
 (0)