Fixed routing for unfound coursewares
This commit is contained in:
@ -57,8 +57,6 @@ exports.returnIndividualCourseware = function(req, res, next) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
next(err);
|
next(err);
|
||||||
}
|
}
|
||||||
courseware = courseware.pop();
|
|
||||||
|
|
||||||
// Handle not found
|
// Handle not found
|
||||||
if (courseware.length < 1) {
|
if (courseware.length < 1) {
|
||||||
req.flash('errors', {
|
req.flash('errors', {
|
||||||
@ -66,6 +64,7 @@ exports.returnIndividualCourseware = function(req, res, next) {
|
|||||||
});
|
});
|
||||||
return res.redirect('/coursewares')
|
return res.redirect('/coursewares')
|
||||||
}
|
}
|
||||||
|
courseware = courseware.pop();
|
||||||
|
|
||||||
// Redirect to full name if the user only entered a partial
|
// Redirect to full name if the user only entered a partial
|
||||||
var dashedNameFull = courseware.name.toLowerCase().replace(/\s/g, '-');
|
var dashedNameFull = courseware.name.toLowerCase().replace(/\s/g, '-');
|
||||||
|
Reference in New Issue
Block a user