mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
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:
parent
817e556ea6
commit
9d8089a748
@ -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];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user