Skip to content
Snippets Groups Projects
Commit b2520f8f authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- fixed issue where some custom asset files are returned multiple times (in...

- fixed issue where some custom asset files are returned multiple times (in the same list) by the api
parent e7a93b14
No related branches found
No related tags found
No related merge requests found
......@@ -3375,8 +3375,6 @@ namespace ClientServer.Controllers.Core.Exercises
var allFileReferencesForFrontend = new List<FilePreviewFromBackend>();
customTestFileReferences =
customTestFileReferences.DistinctBy(p => p.FileReferenceUserFileAssetId).ToList();
foreach (var fileReference in customTestFileReferences)
{
......@@ -3389,8 +3387,6 @@ namespace ClientServer.Controllers.Core.Exercises
});
}
customProjectDescriptionFileReferences =
customProjectDescriptionFileReferences.DistinctBy(p => p.FileReferenceUserFileAssetId).ToList();
foreach (var fileReference in customProjectDescriptionFileReferences)
{
......@@ -3403,9 +3399,6 @@ namespace ClientServer.Controllers.Core.Exercises
});
}
customProjectCustomTestFileReferences =
customProjectCustomTestFileReferences.DistinctBy(p => p.FileReferenceUserFileAssetId).ToList();
foreach (var fileReference in customProjectCustomTestFileReferences)
{
allFileReferencesForFrontend.Add(new FilePreviewFromBackend()
......@@ -3417,6 +3410,11 @@ namespace ClientServer.Controllers.Core.Exercises
});
}
//we do distinct on the whole list because user file can be used as markdown asset and test asset...
//also a test asset can be used in multiple tests... so it's easier to do this on the whole list
allFileReferencesForFrontend = allFileReferencesForFrontend
.DistinctBy(p => p.Id)
.ToList();
await
Response.WriteAsync(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment