From 551e5529280b07176114ae8fa7964dd1c4899862 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 8 Nov 2019 17:24:10 +0700 Subject: [PATCH] Add a fallback API version, allows tests to pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 😏 - this shouldn't really be a thing, but it's better than updating 52 tests... --- core/frontend/services/routing/bootstrap.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/frontend/services/routing/bootstrap.js b/core/frontend/services/routing/bootstrap.js index 5a3435b0f9..03ec150590 100644 --- a/core/frontend/services/routing/bootstrap.js +++ b/core/frontend/services/routing/bootstrap.js @@ -9,6 +9,8 @@ const TaxonomyRouter = require('./TaxonomyRouter'); const PreviewRouter = require('./PreviewRouter'); const ParentRouter = require('./ParentRouter'); +const defaultApiVersion = 'v3'; + const registry = require('./registry'); let siteRouter; @@ -37,7 +39,8 @@ module.exports.init = (options = {start: false}) => { registry.setRouter('siteRouter', siteRouter); if (options.start) { - this.start(options.start); + let apiVersion = _.isBoolean(options.start) ? defaultApiVersion : options.start; + this.start(apiVersion); } return siteRouter.router();