UNPKG

@pubby/sdk

Version:
45 lines (42 loc) 1.34 kB
import { __extends } from 'tslib'; import { Rest } from '../../../lib/Rest.js'; var FriendshipsService = /** @class */ (function (_super) { __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)); export { FriendshipsService as default };