Exemplo n.º 1
0
        public async Task Follow([FromForm] long id)
        {
            await _apiHealper.DoStandartSomething(
                async() =>
            {
                var userInfo = _apiHealper.CheckAuthorized(Request, _jwtService, true);

                bool res = await _articleService.ChangeFollowStatus(id, userInfo);

                await _apiHealper.WriteResponseAsync(Response, _boolResultFactory.GetObjectReturn(new BoolResult(res)));
            }, Response, _logger);
        }
Exemplo n.º 2
0
        public async Task RemoveFromList([FromForm] long card_id, [FromForm] long list_id)
        {
            await _apiHealper.DoStandartSomething(
                async() =>
            {
                var userInfo = _apiHealper.CheckAuthorized(Request, _jwtService, true);

                var res = await _wordsListService.RemoveFromList(card_id, list_id, userInfo);

                await _apiHealper.WriteResponseAsync(Response, _boolResultFactory.GetObjectReturn(new BoolResult(res != null)));
            }, Response, _logger);
        }
Exemplo n.º 3
0
        public async Task LogOut()
        {
            await _apiHealper.DoStandartSomething(
                async() =>
            {
                var accessToken = _apiHealper.GetAccessTokenFromRequest(Request);
                var logout      = await _authSrvice.LogOut(accessToken);
                if (logout)
                {
                    _apiHealper.ClearUsersTokens(Response);
                }


                await _apiHealper.WriteResponseAsync(Response, _boolResultFactory.GetObjectReturn(logout));
            }, Response, _logger);
        }