From f1cb358cf08634330abb7d63f2021e324f848538 Mon Sep 17 00:00:00 2001 From: Mirella Flores Date: Fri, 26 Feb 2021 12:54:25 -0500 Subject: [PATCH] fix auth --- mason/breeders_toolbox/trial/phenotype_heatmap.mas | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mason/breeders_toolbox/trial/phenotype_heatmap.mas b/mason/breeders_toolbox/trial/phenotype_heatmap.mas index 79dc6d8349..6a73296064 100644 --- a/mason/breeders_toolbox/trial/phenotype_heatmap.mas +++ b/mason/breeders_toolbox/trial/phenotype_heatmap.mas @@ -422,9 +422,7 @@ jQuery(document).ready( function() { 'pageSize':1000, 'page':0 }, - headers: { - 'Authorization': `Bearer ` + auth_token, - }, + headers: (auth_token)? {'Authorization': `Bearer ` + auth_token } : {}, beforeSend: function() { jQuery("#working_modal").modal("show"); }, @@ -776,9 +774,7 @@ jQuery(document).ready( function() { jQuery("#ctrldiv").css("display", "none"); jQuery.ajax( { //url: '/ajax/breeders/trial/'+trial_id+'/coords', - headers: { - 'Authorization': `Bearer ` + auth_token, - }, + headers: (auth_token)? {'Authorization': `Bearer ` + auth_token } : {}, url: '/brapi/v1/studies/'+trial_id+'/layout?pageSize=10000&page=0', beforeSend: function() { jQuery("#working_modal").modal("show"); @@ -1346,9 +1342,7 @@ jQuery(document).ready( function() { jQuery("#trait_heatmap").css("display", "none"); field_map_view(); jQuery.ajax ( { - headers: { - 'Authorization': `Bearer ` + auth_token, - }, + headers: (auth_token)? {'Authorization': `Bearer ` + auth_token } : {}, url: '/brapi/v1/studies/'+ <% $trial_id %> +'/observationvariables?pageSize=1000000', //url : '/ajax/breeders/trial/'+ <% $trial_id %> + '/traits_assayed?stock_type='+value, beforeSend: function() {