summaryrefslogtreecommitdiffstats
path: root/js/service/ShareResource.js
blob: d497c18f7c3875ab4619242f5bd6557f333fa176 (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
/**
 * Nextcloud - News
 *
 * @author Marco Nassabain <marco.nassabain@hotmail.com>
 */
app.factory('ShareResource', function (Resource, $http, BASE_URL) {
    'use strict';

    var ShareResource = function ($http, BASE_URL) {
        Resource.call(this, $http, BASE_URL);
    };

    ShareResource.prototype = Object.create(Resource.prototype);

    ShareResource.prototype.getUsers = function (search) {
        console.log(search);
        return this.http({
            url: OC.linkToOCS(`apps/files_sharing/api/v1/sharees?search=${search}&itemType=file`, 1),
            method: 'GET',
        }).then(function(response) {
            return response.data;
        });
    };


    return new ShareResource($http, BASE_URL);
});