Commit 4a610113 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Sprint/2020-04' into 'master'

Sprint/2020-04

See merge request coscine/api/project!76
parents 6531dd74 3736db93
......@@ -59,8 +59,8 @@
<Reference Include="Coscine.Action, Version=1.10.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Coscine.Action.1.10.0\lib\net461\Coscine.Action.dll</HintPath>
</Reference>
<Reference Include="Coscine.ApiCommons, Version=1.6.0.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ApiCommons.1.6.0\lib\net461\Coscine.ApiCommons.dll</HintPath>
<Reference Include="Coscine.ApiCommons, Version=1.6.3.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ApiCommons.1.6.3\lib\net461\Coscine.ApiCommons.dll</HintPath>
</Reference>
<Reference Include="Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll</HintPath>
......
......@@ -5,7 +5,7 @@
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
<package id="Consul" version="0.7.2.6" targetFramework="net472" />
<package id="Coscine.Action" version="1.10.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.6.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.6.3" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.4.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.16.0" targetFramework="net472" />
<package id="Coscine.Logging" version="1.0.1" targetFramework="net472" />
......
......@@ -37,8 +37,7 @@ namespace Coscine.Api.Project.Controllers
return Ok(_projectModel.GetWithAccess(user, UserRoles.Member, UserRoles.Owner).ToList()
.Select((project) => _projectModel.CreateReturnObjectFromDatabaseObject(project))
.OrderBy(element => element.DisplayName)
);
);
}
[HttpGet("[controller]/{id}")]
......@@ -124,13 +123,16 @@ namespace Coscine.Api.Project.Controllers
public void DeleteProject(Database.DataModel.Project project, bool isHard = false, bool propegateAction = true)
{
var subProjectModel = new SubProjectModel();
foreach(var subProject in subProjectModel.GetAllWhere((subProject) => subProject.ProjectId == project.Id))
foreach (var subProject in subProjectModel.GetAllWhere(
(subProject) => subProject.ProjectId == project.Id
&& (subProject.SubProject_FK.Deleted == false || isHard)
))
{
Database.DataModel.Project subProjectObject;
if (isHard)
{
subProjectModel.Delete(subProject);
subProjectObject = _projectModel.GetByIdIncludingDeleted(subProject.SubProjectId);
subProjectModel.Delete(subProject);
}
else
{
......
......@@ -35,7 +35,7 @@ namespace Coscine.Api.Project.Controllers
var subProjects = _subProjectModel.GetAllWhere((subProjectM) => (subProjectM.ProjectId == parentGuid
// Corrosponing subproject must exist
&& subProjectM.Project.Deleted == false
&& subProjectM.SubProject_FK.Deleted == false
// select only subprojects to which the user has access
&& (from projectRole in subProjectM.SubProject_FK.ProjectRolesProjectIdIds
......
......@@ -52,8 +52,8 @@
<Reference Include="Coscine.Action, Version=1.10.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Coscine.Action.1.10.0\lib\net461\Coscine.Action.dll</HintPath>
</Reference>
<Reference Include="Coscine.ApiCommons, Version=1.6.0.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ApiCommons.1.6.0\lib\net461\Coscine.ApiCommons.dll</HintPath>
<Reference Include="Coscine.ApiCommons, Version=1.6.3.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ApiCommons.1.6.3\lib\net461\Coscine.ApiCommons.dll</HintPath>
</Reference>
<Reference Include="Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll</HintPath>
......
......@@ -5,7 +5,7 @@
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
<package id="Consul" version="0.7.2.6" targetFramework="net472" />
<package id="Coscine.Action" version="1.10.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.6.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.6.3" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.4.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.16.0" targetFramework="net472" />
<package id="Coscine.Logging" version="1.0.1" targetFramework="net472" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment