Ejemplo n.º 1
0
        public async Task <IActionResult> GetDownloads(string userid)
        {
            if (userid == "@me")
            {
                userid = UserId;
            }

            var user = await _users.GetByIdAsync(userid);

            if (user == null)
            {
                return(NotFound(new ErrorResponse("The user does not exist.")));
            }

            var downloads = await _downloads.GetByAuthorAsync(userid);

            return(Ok(_mapper.Map <List <DownloadResponse> >(downloads)));
        }