Updated xmlrpc and slack service to use type column

refs #10922
This commit is contained in:
Fabien O'Carroll 2019-08-06 11:27:38 +08:00
parent b45e955dea
commit 44a02c7d36
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ function ping(post) {
if (slackSettings && slackSettings.url && slackSettings.url !== '') {
slackSettings.username = slackSettings.username ? slackSettings.username : 'Ghost';
// Only ping when not a page
if (post.page) {
if (post.type === 'page') {
return;
}

View File

@ -27,7 +27,7 @@ function ping(post) {
title = post.title,
url = urlService.getUrlByResourceId(post.id, {absolute: true});
if (post.page || config.isPrivacyDisabled('useRpcPing') || settingsCache.get('is_private')) {
if (post.type === 'page' || config.isPrivacyDisabled('useRpcPing') || settingsCache.get('is_private')) {
return;
}

View File

@ -192,7 +192,7 @@ describe('Slack', function () {
});
it('does not make a request if post is a page', function () {
const post = testUtils.DataGenerator.forKnex.createPost({page: true});
const post = testUtils.DataGenerator.forKnex.createPost({type: 'page'});
isPostStub.returns(true);
settingsCacheStub.withArgs('slack').returns(slackObjWithUrl);