Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECH] Monter de version @nuxtjs/prismic #281

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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