Skip to content

Commit

Permalink
fix(default-client): adjust locale warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinz93 committed Feb 15, 2022
1 parent 7b53519 commit 9169c33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/create-contentful-api.ts
Expand Up @@ -489,7 +489,9 @@ export default function createContentfulApi<OptionType>(
query: EntriesQueries<Fields> = {}
): Promise<EntryCollectionWithLinkResolution<Fields>> {
if (query.locale === '*') {
console.warn('If you want to fetch all the locales, we recommend to use the .withAllLocales')
console.warn(
'If you want to fetch all the locales, we recommend you to use client.withAllLocales'
)
}
return internalGetEntries<EntryCollectionWithLinkResolution<Fields>>(query, true)
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/getEntries.test.ts
Expand Up @@ -91,7 +91,7 @@ describe('getEntries via chained clients', () => {
client.getEntries({ 'sys.id': 'nyancat', locale: '*' })
expect(consoleWarnSpy).toBeCalled()
expect(consoleWarnSpy.mock.calls[0][0]).toBe(
'If you want to fetch all the locales, we recommend to use the .withAllLocales'
'If you want to fetch all the locales, we recommend you to use client.withAllLocales'
)
})
})
Expand Down

0 comments on commit 9169c33

Please sign in to comment.