mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 14:14:06 +00:00
back again...
bit of validation, some fixes, some auth corrections scrapped graph db stuff some misc. stuff, check the diff if you want bruh
This commit is contained in:
23
validators/playlists.js
Normal file
23
validators/playlists.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { body, header, param, query } = require("express-validator");
|
||||
|
||||
const typedefs = require("../typedefs");
|
||||
|
||||
/**
|
||||
* @param {typedefs.Req} req
|
||||
* @param {typedefs.Res} res
|
||||
* @param {typedefs.Next} next
|
||||
*/
|
||||
const getPlaylistDetailsValidator = async (req, res, next) => {
|
||||
await query("playlist_id")
|
||||
.notEmpty()
|
||||
.withMessage("playlist_id not defined in query")
|
||||
.isAlphanumeric()
|
||||
.withMessage("playlist_id must be alphanumeric (base-62)")
|
||||
.run(req);
|
||||
next();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getPlaylistDetailsValidator,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user