Skip to content

Commit

Permalink
OH Queue route (#50)
Browse files Browse the repository at this point in the history
* working route for ohQueue

* changed controller

* fixed lint

* added api/oh-queue.js

* updated openapi folder for oh queue to resolve errors

* working front end

* fixed lint

* working front end and passing tests

* fixed lint
  • Loading branch information
kmehta5 authored Oct 9, 2024
1 parent a727e71 commit c2a080d
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 1 deletion.
37 changes: 36 additions & 1 deletion public/openapi/read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,39 @@ paths:
"/api/groups/{slug}/members":
$ref: 'read/groups/slug/members.yaml'
/api/outgoing:
$ref: 'read/outgoing.yaml'
$ref: 'read/outgoing.yaml'

/api/oh-queue:
$ref: 'read/oh-queue.yaml'



# /api/oh-queue:
# get:
# tags:
# - oh-queue
# summary: Welcome to the Office Hours Queue page
# description: This route serves a welcome message to the OH queue page.
# responses:
# "200":
# description: A welcome message is presented
# content:
# application/json:
# schema:
# allOf:
# - type: object
# # required:
# # - message
# # properties:
# # message:
# # type: string
# # description: Welcome message for the OH queue page
# # example: "Welcome to the Office Hours Queue page!"








15 changes: 15 additions & 0 deletions public/openapi/read/oh-queue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# bing copilot
get:
responses:
'200':
description: Successful response
# content:
# application/json:
# schema:
# type: object
# # required:
# # - message
# properties:
# message:
# type: string
15 changes: 15 additions & 0 deletions src/api/oh-queue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// source chatGPT
// const controllers = require.main.require('./src/controllers');

'use strict';

module.exports = (app, middleware) => {
app.get('/oh-queue', middleware.buildHeader, (req, res) => {
res.render('oh-queue', {});
});
app.get('/api/oh-queue', (req, res) => {
res.json({
// message: 'Welcome to the Office Hours Queue page!',
});
});
};
12 changes: 12 additions & 0 deletions src/controllers/ohQueue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

'use strict';

const ohQueue = {};

ohQueue.get = function (req, res) {
res.render('oh-queue', {});
};

module.exports = ohQueue;

// bing copilot
5 changes: 5 additions & 0 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const express = require('express');

const meta = require('../meta');
const controllers = require('../controllers');

const ohQueue = require('../controllers/ohQueue');

const controllerHelpers = require('../controllers/helpers');
const plugins = require('../plugins');

Expand Down Expand Up @@ -37,6 +40,8 @@ _mounts.main = (app, middleware, controllers) => {
setupPageRoute(app, '/reset/:code?', [middleware.delayLoading], controllers.reset);
setupPageRoute(app, '/tos', [], controllers.termsOfUse);

setupPageRoute(app, '/oh-queue', [], ohQueue.get);

setupPageRoute(app, '/email/unsubscribe/:token', [], controllers.accounts.settings.unsubscribe);
app.post('/email/unsubscribe/:token', controllers.accounts.settings.unsubscribePost);

Expand Down

0 comments on commit c2a080d

Please sign in to comment.