Use dot notation instead of subscript on response.

This commit is contained in:
voussoir 2020-06-28 16:57:32 -07:00
parent 1e4f4441bb
commit 3044907264
2 changed files with 7 additions and 7 deletions

View file

@ -276,7 +276,7 @@ function refresh_channel_form(force)
} }
function refresh_channel_callback(response) function refresh_channel_callback(response)
{ {
if (response["meta"]["status"] == 200) if (response.meta.status == 200)
{ {
common.refresh(); common.refresh();
} }
@ -489,11 +489,11 @@ function give_action_buttons(video_card_div)
function receive_action_response(response) 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) for (var index = 0; index < video_ids.length; index += 1)
{ {
var video_id = video_ids[index]; var video_id = video_ids[index];
var state = response["data"]["state"]; var state = response.data.state;
var card = document.getElementById("video_card_" + video_id); var card = document.getElementById("video_card_" + video_id);
{% for statename in all_states %} {% for statename in all_states %}
card.classList.remove("video_card_{{statename}}"); card.classList.remove("video_card_{{statename}}");
@ -513,7 +513,7 @@ function set_automark_hook(event)
} }
function set_automark_callback(response) function set_automark_callback(response)
{ {
if (response["meta"]["status"] == 200) if (response.meta.status == 200)
{ {
set_automark_spinner.hide(); set_automark_spinner.hide();
} }

View file

@ -86,9 +86,9 @@ function add_channel_form(event)
} }
function add_channel_callback(response) 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 else
{ {
@ -103,7 +103,7 @@ function refresh_all_channels_form(force)
} }
function refresh_all_channels_callback(response) function refresh_all_channels_callback(response)
{ {
if (response["meta"]["status"] == 200) if (response.meta.status == 200)
{ {
common.refresh(); common.refresh();
} }