Skip to content
Snippets Groups Projects
Commit 7c55b0b4 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Fix: Updates to formatting and output

parent 1d940b92
No related branches found
No related tags found
2 merge requests!15Fix/xxxx index out of range,!14Fix: Organizations
......@@ -288,12 +288,16 @@ public abstract class Reporting<O> where O : class
"
};
using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString());
if (!results.IsEmpty)
{
var inst = results.Select(x => x.Value("inst").ToString()).ToList()[0]; // Get the value for ?inst
if (!string.IsNullOrWhiteSpace(inst))
{
Console.WriteLine($" Organization {organization} found to match {inst}");
organization = inst;
return inst;
}
}
Console.WriteLine($" Could not find match for {organization}");
return organization;
}
}
\ No newline at end of file
using AngleSharp.Dom;
using Coscine.Database.DataModel;
using Coscine.Database.DataModel;
using Coscine.Database.Models;
using Coscine.Database.ReturnObjects;
using Coscine.ResourceTypes;
......
......
......@@ -5,5 +5,5 @@
/// </summary>
public class ReturnObject
{
public List<MaintenanceBannerObject> Banners { get; set; } = new();
public List<MaintenanceBannerObject>? Banners { get; set; } = new();
}
\ No newline at end of file
......@@ -44,7 +44,7 @@ public class SystemReporting : Reporting<SystemReportingOptions>
};
}
private async Task<List<MaintenanceBannerObject>> GetMaintenanceBannersAsync()
private async Task<List<MaintenanceBannerObject>?> GetMaintenanceBannersAsync()
{
var httpClient = new HttpClient();
var requestMessage = new HttpRequestMessage()
......@@ -60,6 +60,10 @@ public class SystemReporting : Reporting<SystemReportingOptions>
var result = await httpClient.SendAsync(requestMessage);
var responseBody = JsonConvert.DeserializeObject<List<MaintenanceBannerObject>>(result.Content.ReadAsStringAsync().Result);
if (responseBody is null)
{
return null;
}
return responseBody.OrderBy(e => e.StartAt).ToList();
}
}
......
......
File changed. Contains only whitespace changes. Show whitespace changes.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment