Update routes & controllers
This commit is contained in:
parent
698fe87024
commit
46d1daa085
8 changed files with 105 additions and 64 deletions
|
|
@ -3,50 +3,50 @@ const {sendError, sendMessage} = require ("../config/response.config");
|
|||
const {checkLogin} = require("../config/sessionJWT.config");
|
||||
const Playlist = db.playlists;
|
||||
|
||||
// Create a new PlaylistDB
|
||||
// Create a new Playlist
|
||||
exports.create = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.create not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.create not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
||||
// Retrieve all Playlists
|
||||
// Retrieve all Playlist from id if admin or session id
|
||||
exports.findAll = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.findAll not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.findAll not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
||||
// Retrieve a single PlaylistDB with id
|
||||
// Find single Playlist from id if admin or session id
|
||||
exports.findOne = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.findOne not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.findOne not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
||||
// Update a PlaylistDB with id
|
||||
// Update a Playlist with playlist id
|
||||
exports.update = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.update not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.update not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
||||
// Delete a PlaylistDB with id
|
||||
// Delete a Playlist with playlist id
|
||||
exports.delete = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.delete not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.delete not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
||||
// Delete all Playlists
|
||||
// Delete all Playlists from id if admin or session id
|
||||
exports.deleteAll = (req, res) => {
|
||||
const token = checkLogin(req, res);
|
||||
if(token){
|
||||
return sendError(res, 501, -1, "PlaylistDB.deleteAll not Implemented", token);
|
||||
return sendError(res, 501, -1, "Playlist.deleteAll not Implemented", token);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue