Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AWare committed Oct 22, 2019
1 parent 13c3f63 commit 7f2ced1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion projects/archiver/src/tasks/image/helpers/media.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('getImage', () => {
showQuotedHeadline: false,
mediaType: 'Image',
elements: [],
fromPrint: true,
isFromPrint: true,
}
expect(getImagesFromArticle(article)).toContain(image)
})
2 changes: 1 addition & 1 deletion projects/backend/__tests__/helpers/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Content = <T extends string>(
showQuotedHeadline,
mediaType,
sportScore,
fromPrint: false,
isFromPrint: false,
})

const Article = ({
Expand Down
16 changes: 8 additions & 8 deletions projects/backend/capi/articles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const getMainMediaAtom = (

const parseArticleResult = async (
result: IContent,
fromPrint: boolean,
isFromPrint: boolean,
): Promise<[number, CAPIContent]> => {
const path = result.id
console.log(`Parsing CAPI response for ${path}`)
Expand Down Expand Up @@ -149,7 +149,7 @@ const parseArticleResult = async (
elements,
starRating,
mainMedia: getMainMediaAtom(result.blocks),
fromPrint,
isFromPrint,
},
]
return article
Expand All @@ -169,7 +169,7 @@ const parseArticleResult = async (
bylineHtml: bylineHtml || '',
standfirst: trail || '',
elements,
fromPrint,
isFromPrint,
},
]

Expand All @@ -190,7 +190,7 @@ const parseArticleResult = async (
bylineHtml: bylineHtml || '',
standfirst: trail || '',
elements,
fromPrint,
isFromPrint,
},
]

Expand Down Expand Up @@ -232,7 +232,7 @@ const parseArticleResult = async (
bylineHtml: bylineHtml || '',
standfirst: trail || '',
crossword,
fromPrint,
isFromPrint,
},
]

Expand Down Expand Up @@ -263,7 +263,7 @@ const parseArticleResult = async (
html: `<pre>${JSON.stringify(result.apiUrl)}</pre>`,
},
],
fromPrint,
isFromPrint,
},
]
}
Expand All @@ -286,7 +286,7 @@ export const getArticles = async (
capi: 'printsent' | 'search',
): Promise<{ [key: string]: CAPIContent }> => {
const paths = ids.map(_ => `internal-code/page/${_}`)
const fromPrint = capi === 'printsent'
const isFromPrint = capi === 'printsent'
const endpoint = capi === 'printsent' ? printsent(paths) : search(paths)
if (endpoint.length > 1000) {
console.warn(
Expand Down Expand Up @@ -322,7 +322,7 @@ export const getArticles = async (
const data = SearchResponseCodec.decode(input)
const results: IContent[] = data.results
const articlePromises = await Promise.all(
results.map(result => attempt(parseArticleResult(result, fromPrint))),
results.map(result => attempt(parseArticleResult(result, isFromPrint))),
)

//If we fail to get an article in a collection we just ignore it and move on.
Expand Down
2 changes: 1 addition & 1 deletion projects/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export interface Content extends WithKey {
showQuotedHeadline: boolean
mediaType: MediaType
sportScore?: string
fromPrint: boolean
isFromPrint: boolean
}
export interface Article extends Content {
type: 'article'
Expand Down

0 comments on commit 7f2ced1

Please sign in to comment.