[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.Mime;
|
||||
using Iceshrimp.Backend.Controllers.Shared.Attributes;
|
||||
using Iceshrimp.Backend.Core.Configuration;
|
||||
using Iceshrimp.Backend.Core.Database;
|
||||
using Iceshrimp.Backend.Core.Database.Tables;
|
||||
using Iceshrimp.Backend.Core.Middleware;
|
||||
|
@ -10,7 +9,6 @@ using Iceshrimp.Shared.Schemas.Web;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.RateLimiting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Iceshrimp.Backend.Controllers.Web;
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ public class InstanceService(
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Iceshrimp.Backend.Core.Configuration;
|
||||
using Iceshrimp.Backend.Core.Database;
|
||||
using Iceshrimp.Backend.Core.Extensions;
|
||||
using Iceshrimp.Backend.Core.Queues;
|
||||
using Iceshrimp.Backend.Core.Services;
|
||||
using Iceshrimp.EntityFrameworkCore.Extensions;
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||
Model ??= new RuleModel();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||
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";
|
||||
ContactEmail = contactEmail;
|
||||
|
||||
Rules = await instance.GetRules();
|
||||
Rules = await instance.GetRulesAsync();
|
||||
|
||||
return Page();
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<Icon Name="Icons.Info" Size="3em"/>
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
</span>
|
||||
<span>@Text</span>
|
||||
|
|
|
@ -148,12 +148,12 @@
|
|||
private string FieldName { get; set; } = "";
|
||||
private string FieldValue { get; set; } = "";
|
||||
private StateButton SaveButton { get; set; } = null!;
|
||||
private IBrowserFile? AvatarFile { get; set; } = null;
|
||||
private bool DelAvatar { get; set; } = false;
|
||||
private IBrowserFile? BannerFile { get; set; } = null;
|
||||
private bool DelBanner { get; set; } = false;
|
||||
private IBrowserFile? AvatarFile { get; set; }
|
||||
private bool DelAvatar { get; set; }
|
||||
private IBrowserFile? BannerFile { get; set; }
|
||||
private bool DelBanner { get; set; }
|
||||
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 EmojiButton { get; set; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue