From 46fd1f6d00f7efc4a15edcc3b650b09aa35f0f6f Mon Sep 17 00:00:00 2001 From: Khaled Garbaya Date: Tue, 24 Oct 2017 13:43:16 +0200 Subject: [PATCH] fix: Fix category listing --- routes/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/routes/index.js b/routes/index.js index ed4b3bb..3ed71c8 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,8 +1,7 @@ const express = require('express') const { catchErrors } = require('../handlers/errorHandlers') -const { getCourses, getCourse, getLesson, getCourseByCategory } = require('./courses') +const { getCourses, getCourse, getLesson, getCoursesByCategory } = require('./courses') const { getSettings, postSettings } = require('./settings') -const { getCategories } = require('./categories') const { getSitemap } = require('./sitemap') const { getLandingPage } = require('./landingPage') const router = express.Router() @@ -12,7 +11,7 @@ router.get('/', catchErrors(getLandingPage)) /* Courses Routes */ router.get('/courses', catchErrors(getCourses)) -router.get('/courses/categories/:category', catchErrors(getCourseByCategory)) +router.get('/courses/categories/:category', catchErrors(getCoursesByCategory)) router.get('/courses/:slug', catchErrors(getCourse)) router.get('/courses/:slug/lessons', catchErrors(getCourse)) router.get('/courses/:cslug/lessons/:lslug', catchErrors(getLesson)) @@ -21,9 +20,6 @@ router.get('/courses/:cslug/lessons/:lslug', catchErrors(getLesson)) router.get('/settings', catchErrors(getSettings)) router.post('/settings', catchErrors(postSettings)) -/* Categories Route */ -router.get('/categories', catchErrors(getCategories)) - /* Sitemap Route */ router.get('/sitemap', catchErrors(getSitemap))