diff --git a/src/eq_schema/builders/routing2/translateRoutingDestination/index.js b/src/eq_schema/builders/routing2/translateRoutingDestination/index.js index c40ea2a9..1443be60 100644 --- a/src/eq_schema/builders/routing2/translateRoutingDestination/index.js +++ b/src/eq_schema/builders/routing2/translateRoutingDestination/index.js @@ -54,11 +54,18 @@ const getLogicalDestination = (pageId, { logical }, ctx) => { ? "summary-group" : "confirmation-group", }; - } else if (logical === "NextPage") { + } + + if (logical === "NextPage") { return getNextPageDestination(pageId, ctx); - } else { - throw new Error(`${logical} is not a valid destination type`); + } + + if (logical === "EndOfCurrentSection") { + return { section: "End"} } + + throw new Error(`${logical} is not a valid destination type`); + }; const translateRoutingDestination = (destination, pageId, ctx) => {