check if stock_dbxref exists before transferring new as it might violate a unique...
[sgn.git] / mason / brapiclient / crops.mas
blobe508a7a2dd4fe90a0905da4552884e0e48ff454a
1 <%args>
2 </%args>
4 <h4>Crops</h4>
6 <div id="brapi_crops_div">
7 <button class="btn btn-primary" id="brapi_home_show_crops">Show Crops</button>
9 </div>
11 <script>
13 jQuery(document).ready(function() {
15 jQuery("#brapi_home_show_crops").click(function() {
16     jQuery.ajax( {
17       'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/crops',
18       'method': 'GET',
19       'success': function(response) {
20         console.log(response);
21         var html = '<br/><ul>';
22         for(var i = 0; i < response.result.data.length; i++) {
23             html = html+'<li>'+response.result.data[i]+'</li>';
24         }
25         html = html+'</ul>';
26         jQuery("#brapi_crops_div").empty().html(html);
27       },
28       error: function(response) {
29         alert('An error occurred getting crops');
30       }
31     });
32 });
34 });
36 </script>