From 3e355209e8720382f24d8b33b16961d86e676fe5 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Mon, 17 Nov 2025 21:03:42 +0100 Subject: [PATCH] Fix TypeScript errors in server actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added explicit return statements after redirect calls in all server actions to satisfy TypeScript type checking. These returns won't be reached due to redirects but are needed for type safety. Fixed in: - userProfileActions.ts (updateUserProfile) - locationActions.ts (updateOrAddLocation, deleteLocationById) - billActions.ts (updateOrAddBill, deleteBill) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/lib/actions/billActions.ts | 12 ++++++++++++ app/lib/actions/locationActions.ts | 12 ++++++++++++ app/lib/actions/userProfileActions.ts | 7 +++++++ 3 files changed, 31 insertions(+) diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index dc58f43..1a26d48 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -282,6 +282,12 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI const locale = await getLocale(); await gotoHomeWithMessage(locale, 'billSaved'); } + + // This return is needed for TypeScript, but won't be reached due to redirect + return { + message: null, + errors: undefined, + }; }) /* Funkcija zamijenjena sa `fetchBillByUserAndId`, koja brže radi i ne treba korisnika @@ -449,4 +455,10 @@ export const deleteBillById = withUser(async (user:AuthenticatedUser, locationID const locale = await getLocale(); await gotoHomeWithMessage(locale, 'billDeleted'); + + // This return is needed for TypeScript, but won't be reached due to redirect + return { + message: null, + errors: undefined, + }; }); \ No newline at end of file diff --git a/app/lib/actions/locationActions.ts b/app/lib/actions/locationActions.ts index 490924c..b8c956e 100644 --- a/app/lib/actions/locationActions.ts +++ b/app/lib/actions/locationActions.ts @@ -225,6 +225,12 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat const locale = await getLocale(); await gotoHomeWithMessage(locale, 'locationSaved'); } + + // This return is needed for TypeScript, but won't be reached due to redirect + return { + message: null, + errors: undefined, + }; }); @@ -405,4 +411,10 @@ export const deleteLocationById = withUser(async (user:AuthenticatedUser, locati const locale = await getLocale(); await gotoHomeWithMessage(locale, 'locationDeleted'); + + // This return is needed for TypeScript, but won't be reached due to redirect + return { + message: null, + errors: undefined, + }; }) \ No newline at end of file diff --git a/app/lib/actions/userProfileActions.ts b/app/lib/actions/userProfileActions.ts index 6ba6484..a33c32e 100644 --- a/app/lib/actions/userProfileActions.ts +++ b/app/lib/actions/userProfileActions.ts @@ -111,4 +111,11 @@ export const updateUserProfile = withUser(async (user: AuthenticatedUser, prevSt // Get current locale and redirect to home with success message const locale = await getLocale(); await gotoHomeWithMessage(locale, 'profileSaved'); + + // This return is needed for TypeScript, but won't be reached due to redirect + return { + message: null, + errors: {}, + success: true, + }; });