Skip to content

Commit

Permalink
[TECH] Monter de version @nuxtjs/prismic
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Jul 9, 2021
2 parents cc7bcf2 + 0977776 commit e58bed1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 33 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const config = {
extensions: ['jpg', 'jpeg', 'gif', 'png', 'webp', 'svg', 'mp4', 'pdf'],
},
],
'@nuxtjs/prismic',
],
/*
** Nuxt.js modules
Expand Down Expand Up @@ -125,7 +126,6 @@ const config = {
},
},
],
'@nuxtjs/prismic',
],
moment: {
locales: ['fr'],
Expand Down
55 changes: 31 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@fortawesome/vue-fontawesome": "^2.0.2",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/dotenv": "^1.4.1",
"@nuxtjs/prismic": "^1.2.4",
"@nuxtjs/prismic": "^1.3.1",
"chart.js": "^2.9.4",
"lodash": "^4.17.21",
"nuxt": "^2.15.1",
Expand Down
6 changes: 3 additions & 3 deletions services/get-routes-to-generate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import prismic from 'prismic-javascript'
import Prismic from '@prismicio/client'

export default async function () {
const api = await prismic.getApi(process.env.PRISMIC_API_ENDPOINT)
const api = await Prismic.getApi(process.env.PRISMIC_API_ENDPOINT)
const { routes, totalPages } = await getRoutesInPage(api, 1)
for (let page = 2; page <= totalPages; page++) {
const { routes: nextPageRoutes } = await getRoutesInPage(api, page)
Expand All @@ -12,7 +12,7 @@ export default async function () {

async function getRoutesInPage(api, page) {
const { results, total_pages: totalPages } = await api.query(
prismic.Predicates.any('document.type', ['simple_page', 'form_page']),
Prismic.Predicates.any('document.type', ['simple_page', 'form_page']),
{
pageSize: 100,
page,
Expand Down
4 changes: 2 additions & 2 deletions tests/services/document-fetcher.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import prismic from 'prismic-javascript'
import prismic from '@prismicio/client'
import { documentFetcher } from '~/services/document-fetcher'

jest.mock('prismic-javascript')
jest.mock('@prismicio/client')

describe('DocumentFetcher', () => {
test('it should get employers page with distributors informations', async () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/services/get-routes-to-generate.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import getRoutesToGenerate from '@/services/get-routes-to-generate'
import prismic from 'prismic-javascript'
jest.mock('prismic-javascript')
import prismic from '@prismicio/client'
jest.mock('@prismicio/client')

describe('#getRoutesToGenerate', () => {
const prismicDocPredicates = prismic.Predicates.any('document.type', [
Expand Down

0 comments on commit e58bed1

Please sign in to comment.