@pubby/sdk
Version:
Pubby Development Kit
47 lines (43 loc) • 1.35 kB
JavaScript
;
var tslib = require('tslib');
var Rest = require('../../../lib/Rest.js');
var FriendshipsService = /** @class */ (function (_super) {
tslib.__extends(FriendshipsService, _super);
function FriendshipsService(api) {
return _super.call(this, api, "friendships") || this;
}
FriendshipsService.prototype.getByUser = function (userId) {
return this.request({
method: "GET",
url: "user/" + userId,
});
};
FriendshipsService.prototype.pending = function (params) {
if (params === void 0) { params = {}; }
return this.request({
method: "GET",
url: "pending",
params: params,
});
};
FriendshipsService.prototype.add = function (userId) {
return this.request({
method: "POST",
url: userId,
});
};
FriendshipsService.prototype.accept = function (requestId) {
return this.request({
method: "PATCH",
url: requestId,
});
};
FriendshipsService.prototype.reject = function (requestId) {
return this.request({
method: "DELETE",
url: requestId,
});
};
return FriendshipsService;
}(Rest.Rest));
module.exports = FriendshipsService;