Notes
![]() ![]() Notes - notes.io |
const standup = require("../../models/standup");
module.exports = function (router) {
//get:the 12 newest stand-up meeting notes
router.get("/standup", function (req, res) {
//res.send("hello");
standup.find({}, (err, standup) => {
//check if error was found or not
if (err) {
res.json({ success: false, message: err }); //return error message
} else {
//check if standup were found in database
if (!standup) {
res.json({ success: false, message: "No standup." }); //return error of no standup found
} else {
res.json({ success: true, standup: standup }); //return success and standup array
}
}
});
});
//post :get new meeting note document
router.post("/standup", function (req, res) {
let note = new standup(req.body);
note.save(function (err, note) {
if (err) {
return res.status(400).json(err);
}
res.status(200).json(note);
});
});
//put
router.put("/updateStandup", (req, res) => {
//check if id was provided
if (!req.body._id) {
res.json({ success: false, message: "No standup is provide" }); //return error message
} else {
//check if id exists in database
standup.findOne({ _id: req.body._id }, (err, standup) => {
//check if id is a valid ID
if (err) {
res.json({ success: false, message: "Not a valid standup id" }); //return error message
} else {
standup.teamMember = req.body.teamMember;
standup.project = req.body.project;
standup.workYesterday = req.body.workYesterday;
standup.workToday = req.body.workToday;
standup.impediment = req.body.impediment;
standup.createOn = req.body.createOn;
standup.save((err) => {
if (err) {
res.json({ success: false, message: err }); //return err message
} else {
res.json({ success: true, message: "standup Updated!" }); //return success message
}
});
}
});
}
});
//del
router.delete("/deleteStandup/:id", (req, res) => {
//check if ID was found in database
if (!req.params.id) {
res.json({ success: false, message: "No id provided" }); //return error message
} else {
//check if id is found in databse
standup.findOne({ _id: req.params.id }, (err, standup) => {
//check if error was found
if (err) {
res.json({ success: false, message: "Invalid id" }); //return error message
} else {
//remove the standup from database
standup.remove((err) => {
if (err) {
res.json({ success: false, message: err }); //return error message
} else {
res.json({ success: true, message: "Standup deleted!" }); //return success message
}
});
}
});
}
});
};
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team