Update navigation to preserve year/month context in redirects
Modified gotoHomeWithMessage to accept optional yearMonth parameter and
updated location actions to redirect with year/month context after save/delete.
Changes:
- Updated gotoHomeWithMessage to accept yearMonth parameter
- Modified redirect URLs to include year and month query params
- updateOrAddLocation now redirects to /${locale}?year=${year}&month=${month}&locationSaved=true
- deleteLocationById now redirects to /${locale}?year=${year}&month=${month}&locationDeleted=true
- Removed unused gotoHome import from locationActions
This ensures users return to the same month view after location operations,
maintaining context and providing success feedback via URL parameters.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,10 @@ export async function gotoHome({year, month}: YearMonth) {
|
||||
await gotoUrl(path);
|
||||
}
|
||||
|
||||
export async function gotoHomeWithMessage(locale: string, message: string) {
|
||||
const path = `/${locale}?${message}=true`;
|
||||
export async function gotoHomeWithMessage(locale: string, message: string, yearMonth?: YearMonth) {
|
||||
const path = yearMonth
|
||||
? `/${locale}?year=${yearMonth.year}&month=${yearMonth.month}&${message}=true`
|
||||
: `/${locale}?${message}=true`;
|
||||
await gotoUrl(path);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user