Skip to content

Commit

Permalink
Merge pull request #91 from MatsMoll/develop
Browse files Browse the repository at this point in the history
[Resource] Added some support for resources
  • Loading branch information
MatsMoll authored Jan 9, 2021
2 parents 2303820 + 7727c1d commit 7817921
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/App/Exam Session/ExamSessionWebController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class ExamSessionWebController: RouteCollection {
TaskSolution.Templates.List.self,
with: .init(
user: user,
solutions: solutions
solutionResources: TaskSolution.Resources(solutions: solutions, resources: [])
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct LectureNoteRecapSessionWebController: RouteCollection {
TaskSolution.Templates.List.self,
with: .init(
user: user,
solutions: solutions
solutionResources: TaskSolution.Resources(solutions: solutions, resources: [])
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ final class PracticeSessionWebController: RouteCollection {
return try req.controllers.practiceSessionController
.get(solutions: req)
.flatMapThrowing { solutions in

try req.htmlkit
.render(
TaskSolution.Templates.List.self,
with: .init(
user: user,
solutions: solutions
solutionResources: solutions
)
)
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/App/Task/Flash Card/FlashCardTaskWebController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ class FlashCardTaskWebController: RouteCollection {
try req.controllers.taskSolutionController
.solutionsForTask(on: req)
.flatMapThrowing { solutions in

try req.htmlkit.render(
TaskSolution.Templates.List.self,
with: .init(
user: req.auth.require(),
solutions: solutions
solutionResources: TaskSolution.Resources(solutions: solutions, resources: [])
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/App/Test Session/TestSessionWebController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class TestSessionWebController: TestSessionWebControlling {
TaskSolution.Templates.List.self,
with: .init(
user: user,
solutions: solutions
solutionResources: TaskSolution.Resources(solutions: solutions, resources: [])
)
)
}
Expand Down

0 comments on commit 7817921

Please sign in to comment.