Merge pull request #5243 from solgenomics/topic/observations_upload_catch_error
[sgn.git] / mason / brapiclient / studytypes.mas
blobc01a38d6059c129883ffaa081faaa03b5c548bf3
1 <%args>
2 </%args>
4 <h4>StudyTypes</h4>
6 <div id="brapi_studytypes_div">
7 <button class="btn btn-primary" id="brapi_home_show_studytypes">Show StudyTypes</button>
9 </div>
11 <script>
13 jQuery(document).ready(function() {
15 jQuery("#brapi_home_show_studytypes").click(function() {
16     jQuery.ajax( {
17       'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/studyTypes',
18       'method': 'GET',
19       'success': function(response) {
20         console.log(response);
21         brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_studytypes_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/studyTypes', undefined);
22       },
23       error: function(response) {
24         alert('An error occurred getting seasons');
25       }
26     });
27 });
29 });
31 </script>