Return initial step for non-existent host records instead of throwing an error

This commit is contained in:
paritosh18
2025-11-20 18:37:26 +05:30
parent 3e12419985
commit 4c17e1b269

View File

@@ -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;