mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
Refactored direct usages of api controllers
refs #9866 - if we start with v2 controllers, the code base should not require specific api controllers - because e.g. `require('../api/posts')` will no longer exist - if you require the api folder, you will get the latest available version by default e.g. `require('../api').posts` - this branch does not touch the test env (!)
This commit is contained in:
parent
727ff183f4
commit
bc4b637e30
@ -3,7 +3,6 @@ const Promise = require('bluebird'),
|
|||||||
localUtils = require('../utils'),
|
localUtils = require('../utils'),
|
||||||
common = require('../../../lib/common'),
|
common = require('../../../lib/common'),
|
||||||
models = require('../../../models'),
|
models = require('../../../models'),
|
||||||
schedules = require('../../../api/schedules'),
|
|
||||||
urlService = require('../../../services/url'),
|
urlService = require('../../../services/url'),
|
||||||
_private = {};
|
_private = {};
|
||||||
|
|
||||||
@ -25,7 +24,8 @@ _private.loadClient = function loadClient() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_private.loadScheduledPosts = function () {
|
_private.loadScheduledPosts = function () {
|
||||||
return schedules.getScheduledPosts()
|
const api = require('../../../api');
|
||||||
|
return api.schedules.getScheduledPosts()
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
return result.posts || [];
|
return result.posts || [];
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@ const Promise = require('bluebird'),
|
|||||||
models = require('../models'),
|
models = require('../models'),
|
||||||
config = require('../config'),
|
config = require('../config'),
|
||||||
common = require('../lib/common'),
|
common = require('../lib/common'),
|
||||||
postsAPI = require('../api/posts');
|
postsAPI = require('./posts');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish a scheduled post
|
* Publish a scheduled post
|
||||||
|
Loading…
Reference in New Issue
Block a user