[sln] Code cleanup
This commit is contained in:
parent
045ce709aa
commit
8ff9aea33a
8 changed files with 10 additions and 11 deletions
|
@ -1,7 +1,6 @@
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Mime;
|
using System.Net.Mime;
|
||||||
using Iceshrimp.Backend.Controllers.Shared.Attributes;
|
using Iceshrimp.Backend.Controllers.Shared.Attributes;
|
||||||
using Iceshrimp.Backend.Core.Configuration;
|
|
||||||
using Iceshrimp.Backend.Core.Database;
|
using Iceshrimp.Backend.Core.Database;
|
||||||
using Iceshrimp.Backend.Core.Database.Tables;
|
using Iceshrimp.Backend.Core.Database.Tables;
|
||||||
using Iceshrimp.Backend.Core.Middleware;
|
using Iceshrimp.Backend.Core.Middleware;
|
||||||
|
@ -10,7 +9,6 @@ using Iceshrimp.Shared.Schemas.Web;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.RateLimiting;
|
using Microsoft.AspNetCore.RateLimiting;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
|
|
||||||
namespace Iceshrimp.Backend.Controllers.Web;
|
namespace Iceshrimp.Backend.Controllers.Web;
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class InstanceService(
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Rule>> GetRules()
|
public async Task<List<Rule>> GetRulesAsync()
|
||||||
{
|
{
|
||||||
return await db.Rules.OrderBy(p => p.Order).ThenBy(p => p.Id).ToListAsync();
|
return await db.Rules.OrderBy(p => p.Order).ThenBy(p => p.Id).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Iceshrimp.Backend.Core.Configuration;
|
using Iceshrimp.Backend.Core.Configuration;
|
||||||
using Iceshrimp.Backend.Core.Database;
|
using Iceshrimp.Backend.Core.Database;
|
||||||
using Iceshrimp.Backend.Core.Extensions;
|
|
||||||
using Iceshrimp.Backend.Core.Queues;
|
using Iceshrimp.Backend.Core.Queues;
|
||||||
using Iceshrimp.Backend.Core.Services;
|
using Iceshrimp.Backend.Core.Services;
|
||||||
using Iceshrimp.EntityFrameworkCore.Extensions;
|
using Iceshrimp.EntityFrameworkCore.Extensions;
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
Model ??= new RuleModel();
|
Model ??= new RuleModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
Model ??= new RuleModel();
|
Model ??= new RuleModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class IndexModel(MetaService meta, InstanceService instance, IOptionsSnap
|
||||||
instanceDescription ?? "This Iceshrimp.NET instance does not appear to have a description";
|
instanceDescription ?? "This Iceshrimp.NET instance does not appear to have a description";
|
||||||
ContactEmail = contactEmail;
|
ContactEmail = contactEmail;
|
||||||
|
|
||||||
Rules = await instance.GetRules();
|
Rules = await instance.GetRulesAsync();
|
||||||
|
|
||||||
return Page();
|
return Page();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<Icon Name="Icons.Info" Size="3em"/>
|
<Icon Name="Icons.Info" Size="3em"/>
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span>@Text</span>
|
<span>@Text</span>
|
||||||
|
|
|
@ -148,12 +148,12 @@
|
||||||
private string FieldName { get; set; } = "";
|
private string FieldName { get; set; } = "";
|
||||||
private string FieldValue { get; set; } = "";
|
private string FieldValue { get; set; } = "";
|
||||||
private StateButton SaveButton { get; set; } = null!;
|
private StateButton SaveButton { get; set; } = null!;
|
||||||
private IBrowserFile? AvatarFile { get; set; } = null;
|
private IBrowserFile? AvatarFile { get; set; }
|
||||||
private bool DelAvatar { get; set; } = false;
|
private bool DelAvatar { get; set; }
|
||||||
private IBrowserFile? BannerFile { get; set; } = null;
|
private IBrowserFile? BannerFile { get; set; }
|
||||||
private bool DelBanner { get; set; } = false;
|
private bool DelBanner { get; set; }
|
||||||
private DateTime Birthday { get; set; } = DateTime.Now;
|
private DateTime Birthday { get; set; } = DateTime.Now;
|
||||||
private bool SetBirthday { get; set; } = false;
|
private bool SetBirthday { get; set; }
|
||||||
private ElementReference Description { get; set; }
|
private ElementReference Description { get; set; }
|
||||||
private ElementReference EmojiButton { get; set; }
|
private ElementReference EmojiButton { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue