Example #1
0
        public static Promise <bool> FetchUnFollowTeam(string teamId)
        {
            var promise = new Promise <bool>();
            var para    = new FollowParameter {
                followeeId = teamId
            };
            var request = HttpManager.POST($"{Config.apiAddress}{Config.apiPath}/unfollow", parameter: para);

            HttpManager.resume(request: request).Then(responseText => {
                var unFollowResponse = JsonConvert.DeserializeObject <Dictionary <string, bool> >(value: responseText);
                promise.Resolve(unFollowResponse["success"]);
            }).Catch(exception => promise.Reject(ex: exception));
            return(promise);
        }
Example #2
0
        public static Promise <bool> FetchFollowUser(string userId)
        {
            var promise = new Promise <bool>();
            var para    = new FollowParameter {
                type       = "user",
                followeeId = userId
            };
            var request = HttpManager.POST($"{Config.apiAddress}/api/follow", para);

            HttpManager.resume(request: request).Then(responseText => {
                var followResponse = JsonConvert.DeserializeObject <Dictionary <string, bool> >(responseText);
                promise.Resolve(followResponse["success"]);
            }).Catch(exception => promise.Reject(exception));
            return(promise);
        }