Update routes & controllers

This commit is contained in:
Yûki VACHOT 2021-12-01 05:28:47 +01:00
parent 698fe87024
commit 46d1daa085
8 changed files with 105 additions and 64 deletions

View file

@ -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);
}
};