aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-04-28 13:47:58 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-04-28 13:47:58 +0200
commitcaa7b4429e68135404ad5a01aa1d7f530abae090 (patch)
tree2f2b2331de7e126bc2552c4e285cd75f69256cf4 /public
parent30f65b62e84fcd9975643716d61fa21bc8495291 (diff)
downloadramaskrik-social-caa7b4429e68135404ad5a01aa1d7f530abae090.tar.gz
ramaskrik-social-caa7b4429e68135404ad5a01aa1d7f530abae090.tar.bz2
ramaskrik-social-caa7b4429e68135404ad5a01aa1d7f530abae090.zip
Update /screenings endpoint to return full info on screenings.
This makes each screening record self-contained, and the json payload more consistent with how it semantically fit together.
Diffstat (limited to 'public')
-rw-r--r--public/js/app.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/public/js/app.js b/public/js/app.js
index 6148be4..c6899a7 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -27,7 +27,7 @@ function fetch_rooms(data_done) {
function load_screenings(data_done) {
let req = new XMLHttpRequest()
req.addEventListener("load", data_done)
- req.open("GET", "http://localhost:8000/screenings.json")
+ req.open("GET", "http://localhost:8000/screenings")
req.responseType = "json"
req.send()
}
@@ -50,13 +50,13 @@ function log_film(film) {
}
window.addEventListener("load", function() {
- /*
load_screenings(function() {
- this.response.forEach(function(film) {
- log_film(film)
+ console.log(this.response)
+ this.response.forEach(function(screening) {
+ console.log(screening.film.title + "@" + screening.room.name + ": " + screening.date)
})
})
- */
+
fetch_rooms(function() {
let table = document.getElementById("screening-table")
let row = document.createElement("tr")