Something went wrong. Try again.
Youtube like application been developed for my MCA semester 6 Main project
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940const db = require("./db");var model = {};
model.getCategories = (req, res, next) => { db.query("SELECT * FROM categories WHERE status = 'Active'", function( error, rows ) { if (rows.length > 0) { req.sidebarData = rows; return next(); } else { req.sidebarData = []; return next(); } }); //console.log("Hello from appmodel");};
model.getDashboardVideos = (req, res, next) => { var query = "SELECT * FROM videos WHERE status = 'Active' and isPublic='true' "; db.query(query, function(error, rows) { if (rows.length > 0) { req.dashBoardData = rows; return next(); } else { req.dashBoardData = []; return next(); } }); //console.log("Hello from appmodel2");};
//export this router to use in our index.jsmodule.exports = { getCategories: model.getCategories, getDashboardVideos: model.getDashboardVideos};