Added missing relations to server db model. Started with server crud. Removed unused relations from detail responses

This commit is contained in:
2024-12-17 22:52:09 +01:00
parent 747712c5c4
commit a34a3ba8b4
20 changed files with 1131 additions and 40 deletions

View File

@@ -24,23 +24,6 @@ public class StarsController : Controller
{
CrudHelper = crudHelper;
StarRepository = starRepository;
CrudHelper.QueryModifier = stars => stars
.Include(x => x.Variables)
.Include(x => x.DockerImages);
CrudHelper.LateMapper = (star, response) =>
{
response.DockerImages = star.DockerImages
.Select(x => Mapper.Map<StarDockerImageDetailResponse>(x))
.ToArray();
response.Variables = star.Variables
.Select(x => Mapper.Map<StarVariableDetailResponse>(x))
.ToArray();
return response;
};
}
[HttpGet]