async deleteOne(req, res) {
        try {
            // 
            const { id } = req.params;
            const song = await Song.findByIdAndRemove({ _id: id });
            // if(!isNumber(id)){
            //     return res.status(404).json({ err: `make sure id:${id} is a number` }); 
            // }
            if (!song) {
                return res.status(404).json({ err: `could not find song with id:${id}` });
            }
            return res.json({success:`song deleted successfully`});
        } catch (err) {
            console.error(err);
            return res.status(500).send(err);
        }
    }
// Method for getting one song from collection
Method for getting one song from collection
Method for getting one song from collection
async deleteOne(req, res) {
        try {
            const { id } = req.params;
            const song = await Song.findByIdAndRemove({ _id: id });
            if(!isNumber(id)){
                return res.status(404).json({ err: `make sure id:${id} is a number` }); 
            }
            if (!song) {
                return res.status(404).json({ err: `could not find song with id:${id}` });
            }
            return res.json({success:`song deleted successfully`});
        } catch (err) {
            console.error(err);
            return res.status(500).send(err);
        }
    }
async deleteOne ( req , res ) { try { const { id } = req . params ; const song = await Song . findByIdAndRemove ( { _id : id } ) ; if ( ! song ) { return res . status ( 404 ) . json ( { err : ` ${ id } ` } ) ; } return res . json ( { success : ` ` } ) ; } catch ( err ) { console . error ( err ) ; return res . status ( 500 ) . send ( err ) ; } }
Method for getting one song from collection
Method for getting one song from collection
//  // if(!isNumber(id)){ //     return res.status(404).json({ err: `make sure id:${id} is a number` });  // }