Exemple #1
0
        public async Task <IActionResult> GetResources([FromRoute] string userId)
        {
            if (UserId == userId || IsAdmin)
            {
                var resources = await resourcesService.ListByAssociatedUser(userId);

                var userResources = mapper.Map <IEnumerable <Resource>, IEnumerable <ResourceMaxDto> >(resources);
                return(new OkObjectResult(userResources));
            }
            else
            {
                return(BadRequest("Can not get resource for this user"));
            }
        }