Move code for browser tests to code-behind.

This commit is contained in:
2020-05-24 20:42:55 +01:00
parent 9f780713c7
commit dc9ca71409
2 changed files with 14 additions and 12 deletions

View File

@@ -31,7 +31,6 @@
} }
@page "/admin/browser_tests" @page "/admin/browser_tests"
@using Marechai.Database.Models
@inherits OwningComponentBase<BrowserTestsService> @inherits OwningComponentBase<BrowserTestsService>
@inject IStringLocalizer<BrowserTestsService> L @inject IStringLocalizer<BrowserTestsService> L
@attribute [Authorize(Roles = "UberAdmin")] @attribute [Authorize(Roles = "UberAdmin")]
@@ -150,14 +149,4 @@
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>
@code
{
List<BrowserTest> _tests;
protected override async Task OnInitializedAsync()
{
_tests = await Service.GetAsync();
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Marechai.Database.Models;
namespace Marechai.Pages.Admin
{
public partial class BrowserTests
{
List<BrowserTest> _tests;
protected override async Task OnInitializedAsync() => _tests = await Service.GetAsync();
}
}