From 4c17e1b2690c07623dd5d4e4b64fbf73963e8476 Mon Sep 17 00:00:00 2001 From: paritosh18 Date: Thu, 20 Nov 2025 18:37:26 +0530 Subject: [PATCH] Return initial step for non-existent host records instead of throwing an error --- src/modules/host/services/host.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index b6b5682..e2e2097 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -53,7 +53,9 @@ export class HostService { }); if (!host) { - throw new ApiError(404, 'Host record not found.'); + // If host record doesn't exist yet, return stepper 1 (NOT_SUBMITTED) + // so callers (like the stepper endpoint) can show initial step. + return { stepper: STEPPER.NOT_SUBMITTED } as any; } return host;