Skip to content
Snippets Groups Projects
Commit f6b4e6aa authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Merge branch 'main' into issue/959-exceptions

parents 45a3a73c a75781ff
No related branches found
No related tags found
1 merge request!54Issue/959 exceptions
......@@ -189,7 +189,20 @@ public abstract class FitConnectClient {
SentSubmission submission) {
var eventLog = await GetEventLogAsync(submission.CaseId, submission.DestinationId);
var status = eventLog.Last(e => e.SubmissionId == submission.SubmissionId);
// TODO Change sorting to __logic__
var status = eventLog
.Where(e => e.SubmissionId == submission.SubmissionId)
.Select(e => CreateSubmissionStatusFromSet(submission, e))
.OrderBy(e => (int)e.SubmissionState)
.Last();
return status;
}
private static SubmissionStatus CreateSubmissionStatusFromSet(SentSubmission submission,
SecurityEventToken status) {
List<Problems>? problems = null;
if (status.Events?.AcceptSubmissionEvent != null) {
......@@ -204,7 +217,8 @@ public abstract class FitConnectClient {
else if (status.Events?.RejectSubmissionEvent != null)
problems = status.Events.RejectSubmissionEvent.Problems;
return new SubmissionStatus(status.EventType, problems);
var result = new SubmissionStatus(status.EventType, problems);
return result;
}
/// <summary>
......
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