Removed deprecated routes.yaml data format

refs: https://github.com/TryGhost/Ghost/issues/10434
refs: https://github.com/TryGhost/Ghost/pull/10449
refs: https://github.com/TryGhost/Ghost/pull/10559

- We originally had a weird structure returned for data keys in routes.yaml.
- To the best of my knowledge this was never desired or really used
- I'm removing it now simply because I'm trying to remove all references to v2/v3 in tests, and this had a comment saying it was deprecated in v3
- I could have changed the comment to be a proper @deprecated comment and leave this til we rewrite dynamic routing
- However it's weird and confusing and I believe entirely unused - so getting rid is way way better
This commit is contained in:
Hannah Wolfe 2022-01-21 20:03:05 +00:00
parent 817e556ea6
commit 9d8089a748
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037
2 changed files with 0 additions and 10 deletions

View File

@ -113,8 +113,6 @@ function fetchData(pathOptions, routerOptions, locals) {
if (config.type === 'browse') {
response.data[name].meta = results[name].meta;
// @TODO remove in v3
response.data[name][config.resource] = results[name][config.resource];
}
});
}

View File

@ -108,13 +108,9 @@ describe('Unit - services/routing/helpers/fetch-data', function () {
should.exist(result);
result.should.be.an.Object().with.properties('posts', 'meta', 'data');
result.data.should.be.an.Object().with.properties('featured');
result.data.featured.should.be.an.Object().with.properties('posts', 'meta');
result.data.featured.should.not.have.properties('data');
result.posts.length.should.eql(posts.length);
result.data.featured.length.should.eql(posts.length);
// @TODO v3 will deprecate this style (featured.posts)
result.data.featured.posts.length.should.eql(posts.length);
browsePostsStub.calledTwice.should.be.true();
browsePostsStub.firstCall.args[0].should.have.property('include', 'authors,tags');
@ -144,13 +140,9 @@ describe('Unit - services/routing/helpers/fetch-data', function () {
result.should.be.an.Object().with.properties('posts', 'meta', 'data');
result.data.should.be.an.Object().with.properties('featured');
result.data.featured.should.be.an.Object().with.properties('posts', 'meta');
result.data.featured.should.not.have.properties('data');
result.posts.length.should.eql(posts.length);
result.data.featured.length.should.eql(posts.length);
// @TODO v3 will deprecate this style (featured.posts)
result.data.featured.posts.length.should.eql(posts.length);
browsePostsStub.calledTwice.should.be.true();
browsePostsStub.firstCall.args[0].should.have.property('include', 'authors,tags');