Apps / <%= app.id %>
+Apps / <%= app.id %>
Jobs
+jobs
+Notifications
+notifications
+Profile
-profile
-From 09e905a0d8627f2a762548237b45b5bfe3dffb91 Mon Sep 17 00:00:00 2001 From: wajeht <58354193+wajeht@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:06:54 -0500 Subject: [PATCH] feat: Add notifications and jobs page handlers for settings and header components --- src/handler.ts | 16 ++++++++++++---- src/router.ts | 7 +++++-- src/views/components/header.html | 9 ++++----- src/views/layouts/app.html | 10 +++++----- src/views/layouts/auth.html | 2 +- src/views/pages/jobs.html | 4 ++++ src/views/pages/notifications.html | 4 ++++ src/views/pages/profile.html | 4 ---- 8 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 src/views/pages/jobs.html create mode 100644 src/views/pages/notifications.html delete mode 100644 src/views/pages/profile.html diff --git a/src/handler.ts b/src/handler.ts index fcabd6e..1005b13 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -43,10 +43,18 @@ export function getSettingsPageHandler(req: Request, res: Response) { }); } -// GET /profile -export function getProfilePageHandler(req: Request, res: Response) { - return res.render('profile.html', { - path: '/profile', +// GET /notifications +export function getNotificationsPageHandler(req: Request, res: Response) { + return res.render('settings.html', { + path: '/notifications', + layout: '../layouts/auth.html', + }); +} + +// GET /jobs +export function getJobsPageHandler(req: Request, res: Response) { + return res.render('jobs.html', { + path: '/jobs', layout: '../layouts/auth.html', }); } diff --git a/src/router.ts b/src/router.ts index ff6f286..0f1439f 100644 --- a/src/router.ts +++ b/src/router.ts @@ -3,12 +3,13 @@ import { postNotificationHandler, getHomePageHandler, getAppsPageHandler, + getJobsPageHandler, + getNotificationsPageHandler, postCreateAppHandler, getNewAppChannelPageHandler, getAppPageHandler, getTermsOfServicePageHandler, getSettingsPageHandler, - getProfilePageHandler, getLogoutHandler, getCreateNewAppPageHandler, getAppNotificationsPageHandler, @@ -45,7 +46,9 @@ router.get('/apps/:id/notifications', catchAsyncErrorMiddleware(getAppNotificati router.get('/settings', catchAsyncErrorMiddleware(getSettingsPageHandler)); -router.get('/profile', catchAsyncErrorMiddleware(getProfilePageHandler)); +router.get('/jobs', catchAsyncErrorMiddleware(getJobsPageHandler)); + +router.get('/notifications', catchAsyncErrorMiddleware(getNotificationsPageHandler)); router.get('/logout', catchAsyncErrorMiddleware(getLogoutHandler)); diff --git a/src/views/components/header.html b/src/views/components/header.html index d5d693d..c991132 100644 --- a/src/views/components/header.html +++ b/src/views/components/header.html @@ -6,14 +6,13 @@
jobs
+notifications
+profile
-