0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Removed versioned routing configs

refs: https://github.com/TryGhost/Toolbox/issues/228

- we are getting rid of the concept of having multiple api versions in a single ghost install
- we no longer need versioned routing configs
This commit is contained in:
Hannah Wolfe 2022-04-06 12:55:50 +01:00 committed by Daniel Lockyer
parent 8bd9169298
commit 608258747a
No known key found for this signature in database
GPG key ID: D21186F0B47295AD
7 changed files with 3 additions and 174 deletions

View file

@ -1,4 +1,3 @@
/* eslint-disable */
module.exports.QUERY = {
tag: {
controller: 'tagsPublic',
@ -58,4 +57,3 @@ module.exports.TAXONOMIES = {
resource: 'authors'
}
};
/* eslint-enable */

View file

@ -1,54 +0,0 @@
/* eslint-disable */
module.exports.QUERY = {
tag: {
controller: 'tagsPublic',
type: 'read',
resource: 'tags',
options: {
slug: '%s',
visibility: 'public'
}
},
author: {
controller: 'authorsPublic',
type: 'read',
resource: 'authors',
options: {
slug: '%s'
}
},
post: {
controller: 'postsPublic',
type: 'read',
resource: 'posts',
options: {
slug: '%s'
}
},
page: {
controller: 'pagesPublic',
type: 'read',
resource: 'pages',
options: {
slug: '%s'
}
},
preview: {
controller: 'preview',
resource: 'preview'
}
};
module.exports.TAXONOMIES = {
tag: {
filter: 'tags:\'%s\'+tags.visibility:public',
editRedirect: '#/tags/:slug/',
resource: 'tags'
},
author: {
filter: 'authors:\'%s\'',
editRedirect: '#/staff/:slug/',
resource: 'authors'
}
};
/* eslint-enable */

View file

@ -1,54 +0,0 @@
/* eslint-disable */
module.exports.QUERY = {
tag: {
controller: 'tagsPublic',
type: 'read',
resource: 'tags',
options: {
slug: '%s',
visibility: 'public'
}
},
author: {
controller: 'authorsPublic',
type: 'read',
resource: 'authors',
options: {
slug: '%s'
}
},
post: {
controller: 'postsPublic',
type: 'read',
resource: 'posts',
options: {
slug: '%s'
}
},
page: {
controller: 'pagesPublic',
type: 'read',
resource: 'pages',
options: {
slug: '%s'
}
},
preview: {
controller: 'preview',
resource: 'preview'
}
};
module.exports.TAXONOMIES = {
tag: {
filter: 'tags:\'%s\'+tags.visibility:public',
editRedirect: '#/tags/:slug/',
resource: 'tags'
},
author: {
filter: 'authors:\'%s\'',
editRedirect: '#/staff/:slug/',
resource: 'authors'
}
};
/* eslint-enable */

View file

@ -1,61 +0,0 @@
/* eslint-disable */
module.exports.QUERY = {
tag: {
controller: 'tagsPublic',
type: 'read',
resource: 'tags',
options: {
slug: '%s',
visibility: 'public'
}
},
author: {
controller: 'authorsPublic',
type: 'read',
resource: 'authors',
options: {
slug: '%s'
}
},
post: {
controller: 'postsPublic',
type: 'read',
resource: 'posts',
options: {
slug: '%s'
}
},
page: {
controller: 'pagesPublic',
type: 'read',
resource: 'pages',
options: {
slug: '%s'
}
},
preview: {
controller: 'preview',
resource: 'preview'
},
email: {
controller: 'emailPost',
resource: 'email_posts',
options: {
slug: '%s'
}
}
};
module.exports.TAXONOMIES = {
tag: {
filter: 'tags:\'%s\'+tags.visibility:public',
editRedirect: '#/tags/:slug/',
resource: 'tags'
},
author: {
filter: 'authors:\'%s\'',
editRedirect: '#/settings/staff/:slug/',
resource: 'authors'
}
};
/* eslint-enable */

View file

@ -103,7 +103,7 @@ class RouterManager {
*/
start(routerSettings) {
debug('routing start', routerSettings);
const RESOURCE_CONFIG = require(`./config/canary`);
const RESOURCE_CONFIG = require(`./config`);
const unsubscribeRouter = new UnsubscribeRouter();
this.siteRouter.mountRouter(unsubscribeRouter.router());

View file

@ -429,7 +429,7 @@ module.exports = function validate(object) {
}
// TODO: extract this config outta here! the config should be passed into this module
RESOURCE_CONFIG = require('../../../frontend/services/routing/config/canary');
RESOURCE_CONFIG = require('../../../frontend/services/routing/config');
object.routes = _private.validateRoutes(object.routes);
object.collections = _private.validateCollections(object.collections);

View file

@ -4,7 +4,7 @@ const settingsCache = require('../../../../../core/shared/settings-cache');
const controllers = require('../../../../../core/frontend/services/routing/controllers');
const TaxonomyRouter = require('../../../../../core/frontend/services/routing/TaxonomyRouter');
const RESOURCE_CONFIG = require('../../../../../core/frontend/services/routing/config/canary');
const RESOURCE_CONFIG = require('../../../../../core/frontend/services/routing/config');
describe('UNIT - services/routing/TaxonomyRouter', function () {
let req;