Wrapper update + Search by music id

This commit is contained in:
Pablo Ferreiro 2022-01-17 21:11:40 +01:00
parent fe5c2dc459
commit 4f35d68049
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
9 changed files with 77 additions and 17 deletions

View file

@ -19,6 +19,14 @@ const goToVideo = e => {
window.location.href = `./video/${video_id}`
}
const goToMusic = e => {
e.preventDefault()
const formData = new FormData(e.target)
const video_id = formData.get('music_id')
window.location.href = `./music/${video_id}`
}
document.getElementById('username_form').addEventListener('submit', goToUser, false)
document.getElementById('tag_form').addEventListener('submit', goToTag, false)
document.getElementById('video_form').addEventListener('submit', goToVideo, false)
document.getElementById('music_form').addEventListener('submit', goToMusic, false)