Skip to content

Commit

Permalink
Merge pull request #25 from MatsMoll/fix/minor-improvments
Browse files Browse the repository at this point in the history
[fix] Minor improvments
  • Loading branch information
MatsMoll authored Feb 13, 2020
2 parents b55ae82 + c1a3ce7 commit f4583b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Public/assets/js/flash-card/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function editFlashCard() {
}
})
.then(function (json) {
window.location.href = "/tasks/flash-card/" + json.id;
window.location.href = "/creator/tasks/flash-card/" + json.id + "/edit?wasUpdated=true";
})
.catch(function (error) {
presentErrorMessage(error.message);
Expand Down
8 changes: 7 additions & 1 deletion Sources/App/Subject Test/SubjectTestWebController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,18 @@ class SubjectTestWebController<API: SubjectTestAPIControlling>: SubjectTestWebCo
.map { _ in
req.redirect(to: "results")
}
.catchMap { error in
switch error {
case SubjectTest.DatabaseRepository.Errors.alreadyEnded: return req.redirect(to: "results")
default: throw error
}
}
}

static func results(on req: Request) throws -> EventLoopFuture<HTTPResponse> {

let user = try req.requireAuthenticated(User.self)

return try API.results(on: req)
.map { results in

Expand Down

0 comments on commit f4583b5

Please sign in to comment.