diff --git a/frontends/ycdl_flask/templates/channel.html b/frontends/ycdl_flask/templates/channel.html index b6671ed..1d0a5ac 100644 --- a/frontends/ycdl_flask/templates/channel.html +++ b/frontends/ycdl_flask/templates/channel.html @@ -276,7 +276,7 @@ function refresh_channel_form(force) } function refresh_channel_callback(response) { - if (response["meta"]["status"] == 200) + if (response.meta.status == 200) { common.refresh(); } @@ -489,11 +489,11 @@ function give_action_buttons(video_card_div) function receive_action_response(response) { - var video_ids = response["data"]["video_ids"]; + var video_ids = response.data.video_ids; for (var index = 0; index < video_ids.length; index += 1) { var video_id = video_ids[index]; - var state = response["data"]["state"]; + var state = response.data.state; var card = document.getElementById("video_card_" + video_id); {% for statename in all_states %} card.classList.remove("video_card_{{statename}}"); @@ -513,7 +513,7 @@ function set_automark_hook(event) } function set_automark_callback(response) { - if (response["meta"]["status"] == 200) + if (response.meta.status == 200) { set_automark_spinner.hide(); } diff --git a/frontends/ycdl_flask/templates/channels.html b/frontends/ycdl_flask/templates/channels.html index 1cee918..c3d5436 100644 --- a/frontends/ycdl_flask/templates/channels.html +++ b/frontends/ycdl_flask/templates/channels.html @@ -86,9 +86,9 @@ function add_channel_form(event) } function add_channel_callback(response) { - if (response["meta"]["status"] == 200) + if (response.meta.status == 200) { - window.location.href = "/channel/" + response["data"]["id"]; + window.location.href = "/channel/" + response.data.id; } else { @@ -103,7 +103,7 @@ function refresh_all_channels_form(force) } function refresh_all_channels_callback(response) { - if (response["meta"]["status"] == 200) + if (response.meta.status == 200) { common.refresh(); }