Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and rename assignments.js to flashcard.js #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions server/routes/assignments.js → server/routes/flashcard.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
const {getAllAssignments, addNewAssignment, deleteAssignment,updateAssignment} = require('../database/assignmentFunctions');
onst {findAssignmentsByClassID, addNewAssignment, deleteAssignment,updateAssignment} = require('../database/flashcardFunctions');
const express = require('express');
const router = express.Router();


// print out all the assignments in a particular class.
router.get('/', async(req, res) =>{
const assignments = await getAllAssignments(req.body.class_ID, req.body.assignment);
const assignments = await findAssignmentsByClassID(req.body.class_ID, req.body.assignmentName);
res.send(assignments)
});
//

// Add assignment to class
// create assignment to class
router.post('/', async (req, res) => {
await addNewAssignment(req,res);
});
Expand All @@ -20,7 +19,7 @@ router.post('/', async (req, res) => {
});

// update assignment in a particular class. This function requires 3 parameters: class_ID, name of assignment, and new assignment
router.put('/update/:update_assignment', async (req,res) =>{
await updateAssignment(req,res);
})
router.put('/update/:update_assignment', async (req,res) =>{
await updateAssignment(req,res);
})
module.exports = router;