Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab finished with full crud #10

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
added the deleted song.js
JackieC1993 committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6e4ae0302f39fac0bf6dacb79fc528c1481f6e3d
2 changes: 1 addition & 1 deletion back-end/db/seed.sql
Original file line number Diff line number Diff line change
@@ -7,4 +7,4 @@ INSERT INTO songs (name, artist, album, time, is_favorite)
VALUES
('Blinding Ligit', 'TheWeeknd','After Hours', '3:23', true),
('To Be Loved', 'Adele','30', '6:43', false),
('Save Your Tears', 'TheWeeknd','After Hours', '3:35', true);
('Save Your Tears', 'TheWeeknd','After Hours', '3:35', true);
2 changes: 1 addition & 1 deletion back-end/package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"start": "node server.js",
"db:init": "psql -U postgres -f db/schema.sql",
"db:init": "psql -U postgres -f db/schema.sql; psql -U postgres -f db/seed.sql",
"db:seed": "psql -U postgres -f db/seed.sql",
"test": "jest --runInBand"
},
6 changes: 3 additions & 3 deletions back-end/validations/checkSongs.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ const checkArtist = (req, res, next) => {
return next()
} else {
res.status(400).json({ error: 'Artist is required'})
}
}}
const checkAlbum = (req, res, next) => {
if(req.body.album){
// next() comes from the parameters
@@ -43,6 +43,6 @@ const checkArtist = (req, res, next) => {
res.status(400).json({ error: 'Album is required'})
}
}


module.exports = { checkName, checkBoolean, checkArtist, checkTime ,checkAlbum }

module.exports = { checkName, checkBoolean, checkArtist, checkTime ,checkAlbum}