summaryrefslogtreecommitdiff
path: root/client/js/services/Network.js
blob: a0cd5a4b6028690ee6ac433bbae64d16e413e045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

mainApp.factory('Network', ['$http', 'Identity', function ($http, Identity) {

        // Data object
        var data = {};
        data.networks = null; // Networks

        /**
         * ListId
         * @param {type} fileToUpload
         * @param {type} callback
         * @returns {undefined}
         */
        var ListId = function (fileToUpload, callback) {
            var result = $http.post('../server/index.php',
                    $.param({"token": Identity.getToken(), "task": "network", 'action': 'list_network_ids'}));

            // Wait and handle the response
            result.then(function (response) {
                callback(parseUploadImageAnswer(response, false));
            }, function (response) {
                callback(parseUploadImageAnswer(response, true));
            });
        };


    }]);