Browse Source

feat: add utility to determine submission path based on marriage profile status

front-test-2
ghorbani 4 weeks ago
parent
commit
14d1022b4f
  1. 10
      src/lib/get-submit-path.ts

10
src/lib/get-submit-path.ts

@ -55,11 +55,7 @@ export function getSubmitPath(profile: MarriageProfileResponse | undefined) {
return "/terms"; return "/terms";
} }
if (profile.status === "pending_info" && !isMatchSubmitted) {
return "/questions-list";
}
if (profile.status === "waiting" || isMatchSubmitted) {
if (profile.status === "waiting") {
return "/finding-match"; return "/finding-match";
} }
@ -71,10 +67,6 @@ export function getSubmitPath(profile: MarriageProfileResponse | undefined) {
return "/finding-match"; return "/finding-match";
} }
if (profile.status === "waiting") {
return "/finding-match";
}
if (profile.status === "pending_info") { if (profile.status === "pending_info") {
// The backend may still report pending_info for a moment right after the // The backend may still report pending_info for a moment right after the
// match request is sent, so honour a short grace window to avoid bouncing // match request is sent, so honour a short grace window to avoid bouncing

Loading…
Cancel
Save