feat: update query parameter handling for week selection; improve fallback logic for week definition creation
Build and Deploy / build (push) Successful in 1m21s
Build and Deploy / build (push) Successful in 1m21s
This commit is contained in:
@@ -39,7 +39,7 @@ public partial class WeeklyBalancePage : ComponentBase
|
|||||||
{
|
{
|
||||||
await _weekSelector.EnsureLoadedAsync();
|
await _weekSelector.EnsureLoadedAsync();
|
||||||
|
|
||||||
// Handle query parameter ?week=2 (WeekDefinitionId)
|
// Handle query parameter ?week=7 (WeekDefinitionId)
|
||||||
if (!string.IsNullOrEmpty(QueryWeekNumber))
|
if (!string.IsNullOrEmpty(QueryWeekNumber))
|
||||||
{
|
{
|
||||||
// Try to parse as WeekDefinitionId first (most common from dashboard links)
|
// Try to parse as WeekDefinitionId first (most common from dashboard links)
|
||||||
@@ -52,6 +52,13 @@ public partial class WeeklyBalancePage : ComponentBase
|
|||||||
{
|
{
|
||||||
_selectedWeekDefinition = _weekSelector.FindByWeekOrder(weekOrder);
|
_selectedWeekDefinition = _weekSelector.FindByWeekOrder(weekOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If still not found in cache, create a temporary definition with just the Id
|
||||||
|
// so we can still query the balance from BFF
|
||||||
|
if (_selectedWeekDefinition == null)
|
||||||
|
{
|
||||||
|
_selectedWeekDefinition = new WeekDefinitionDto { Id = id, DisplayName = $"هفته {id}" };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user