Fix resource bug

This commit is contained in:
Thomas Fransolet 2021-10-14 19:48:00 +02:00
parent 16d4d6335d
commit 86ad5a2792

View File

@ -48,7 +48,7 @@ namespace ManagerService.Controllers
{ {
List<Resource> resources = _resourceService.GetAll(); List<Resource> resources = _resourceService.GetAll();
return new OkObjectResult(resources.Select(r => r.ToDTO())); return new OkObjectResult(resources.Select(r => r.ToDTO(r.Type == ResourceType.ImageUrl)));
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -213,7 +213,7 @@ namespace ManagerService.Controllers
Resource resourceCreated = _resourceService.Create(resource); Resource resourceCreated = _resourceService.Create(resource);
return new OkObjectResult(resourceCreated.ToDTO()); return new OkObjectResult(resourceCreated.ToDTO(resource.Type == ResourceType.ImageUrl));
} }
catch (ArgumentNullException ex) catch (ArgumentNullException ex)
{ {