Announcement

Collapse
No announcement yet.

Remove GET and POST requests through API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove GET and POST requests through API

    I've added external js-script link into <head> of my main.html
    Code:
    <head>
    ....
    <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.suggestions/16.5.3/js/jquery.suggestions.min.js"></script>
    </head>
    and add js-script into beginning of edit.tpl file of my address field
    Code:
    <script type="text/javascript">
    (function($){
      $(document).ready(
          function() {
        $("#address").suggestions({
            serviceUrl: "https://suggestions.dadata.ru/suggestions/api/4_1/rs",
            token: "xxx",
            type: "ADDRESS",
            count: 5,
            onSelect: function(suggestion) {
                console.log(suggestion);
            }
        });
    });
    })(jQuery);
    </script>
    Now all requests going through API and nothing works! How can I fix that?
    espo.min.js?r=1465563870645:4 GET http://-my-server-/api/v1/https://su...status/address 404 (Not Found)
    espo.min.js?r=1465563870645:4 POST http://-my-server-/api/v1/https://su...uggest/address 404 (Not Found)

  • #2
    OK, i've made it through jsLibs.json and address.js as it said here http://forum.espocrm.com/forum/devel...tom-javascript, but even after that it keeps adding http://-my-server-/api/v1/ part to my request, gosh, it makes me insane, could anyone help?
    Added that to jslibs.json
    Code:
        "Dadata": {
            "path": "client/lib/jquery.suggestions.min.js",
            "exportsTo": "window",
            "exportsAs": "Dadata"
        },
    and that at the end of address.js
    Code:
    Espo.define('Crm:Views.Dashlets.Abstract.Chart', ['Views.Dashlets.Abstract.Base', 'lib!Dadata'], function (Dep, Dadata) {
    
        return Dep.extend({
    
        });
    
    });

    Comment

    Working...
    X