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

Implementing confirm playlist array on confirm() button and server #27

Merged
merged 13 commits into from
Sep 9, 2020

Conversation

stephaniejnc
Copy link
Owner

Comments

So the problem with the previous implementation was that on a playlist selection, that playlist ID gets passed to the server to load the tracks, but it also populates the playlist_array (which we don't want, since the user hasn't pressed the confirm() button). The JS in playlist.ejs also successfully read the playlist_array from the server (ie. reads the length correctly, so it does go to /recommend).

What I'm trying to do

On the server, we now have a var 'playlist', which stores the selected playlist, and an array 'playlist_array', which stores the confirmed playlists. So the confirm() button should also send the playlist ID to the server to populate the 'playlist_array' via the POST '/confirmPlaylist' (in addition to adding all the tracks to Datastore). When I run this, I can see the tracks being added to Datastore in the confirm() function, but it doesn't seem to execute the POST (missing on both console + terminal).

The POST '/confirmPlaylist' starts on line 252 on server.js, and the confirm() button starts on like 213 on playlist.ejs.

Copy link
Collaborator

@chiujess chiujess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMAZING! Looks good to merge :))

@stephaniejnc stephaniejnc merged commit 1fa8339 into master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants