Store Filter between pages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Helper;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
@@ -46,12 +47,31 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
if(!CurrentUser.IsAdmin()) NavigationManager.NavigateTo("/");
|
||||
|
||||
// Load Filter
|
||||
var filter = await LocalStorageService.GetItem<ProspectFilter>(StorageKeys.ProspectFilter);
|
||||
if (filter != null) Filter = filter;
|
||||
|
||||
// Load prospects
|
||||
await LoadProspects();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method FilterChangedAsync
|
||||
|
||||
/// <summary>
|
||||
/// Updates the current filter with the specified ProspectFilter object.
|
||||
/// </summary>
|
||||
/// <param name="arg">The ProspectFilter object containing the updated filter criteria.</param>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
private async Task FilterChangedAsync(ProspectFilter arg)
|
||||
{
|
||||
Filter = arg;
|
||||
await LocalStorageService.SetItem(StorageKeys.ProspectFilter, Filter);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user