Skip to content

Commit

Permalink
Editorial only search
Browse files Browse the repository at this point in the history
  • Loading branch information
kanaabe committed Nov 4, 2016
1 parent 5d0774c commit 336e895
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.test
Expand Up @@ -10,6 +10,7 @@ ELASTICSEARCH_URL=http://localhost:9200
SALT=$2a$10$PJrPMBadu1NPdmnshBgFbe
API_MAX=100
API_PAGE_SIZE=10
EDITORIAL_CHANNEL=5086df098523e60002000018

ARTSY_ID=REPLACE
ARTSY_SECRET=REPLACE
Expand Down
4 changes: 2 additions & 2 deletions api/apps/articles/model/save.coffee
Expand Up @@ -21,7 +21,7 @@ Article = require './index'
{ ObjectId } = require 'mongojs'
cloneDeep = require 'lodash.clonedeep'
{ ARTSY_URL, SAILTHRU_KEY, SAILTHRU_SECRET,
FORCE_URL, ARTSY_EDITORIAL_ID, SECURE_IMAGES_URL, GEMINI_CLOUDFRONT_URL } = process.env
FORCE_URL, ARTSY_EDITORIAL_ID, SECURE_IMAGES_URL, GEMINI_CLOUDFRONT_URL, EDITORIAL_CHANNEL } = process.env
sailthru = require('sailthru-client').createSailthruClient(SAILTHRU_KEY,SAILTHRU_SECRET)
artsyXapp = require('artsy-xapp').token or ''

Expand Down Expand Up @@ -167,7 +167,7 @@ getDescription = (article) =>
published: article.published
published_at: article.published_at
scheduled_publish_at: article.scheduled_publish_at
visible_to_public: article.published and sections and sections.length > 0
visible_to_public: article.published and sections?.length > 0 and article.channel_id is EDITORIAL_CHANNEL
author: article.author and article.author.name or ''
featured: article.featured
tags: article.tags
Expand Down
1 change: 1 addition & 0 deletions api/apps/articles/test/model/index.coffee
Expand Up @@ -693,6 +693,7 @@ describe 'Article', ->
author_id: '5086df098523e60002000018'
title: 'foo article'
published: true
channel_id: '5086df098523e60002000018'
}, 'foo', (err, article) ->
return done err if err
setTimeout( =>
Expand Down

0 comments on commit 336e895

Please sign in to comment.