@treely/strapi-slices 7.5.4 → 7.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/strapi.d.ts +1 -0
- package/dist/strapi-slices.cjs.development.js +6 -5
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +6 -5
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/strapi.ts +1 -0
- package/src/integrations/strapi/getPortfolioProjects.ts +5 -2
- package/src/integrations/strapi/getStrapiCollectionType.ts +2 -1
- package/src/integrations/strapi/getStrapiSingleType.ts +2 -1
- package/src/slices/Events/Events.tsx +6 -3
package/package.json
CHANGED
package/src/constants/strapi.ts
CHANGED
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
PortfolioProject,
|
|
5
5
|
StrapiProject,
|
|
6
6
|
} from '../..';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
STRAPI_DEFAULT_PAGE_SIZE,
|
|
9
|
+
STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
10
|
+
} from '../../constants/strapi';
|
|
8
11
|
import FPMProject from '../../models/fpm/FPMProject';
|
|
9
12
|
import fpmClient from '../fpmClient';
|
|
10
13
|
import strapiClient from './strapiClient';
|
|
@@ -17,7 +20,7 @@ const getPortfolioProjects = async (
|
|
|
17
20
|
): Promise<PortfolioProject[]> => {
|
|
18
21
|
const cache = preview ? false : undefined;
|
|
19
22
|
const params: Record<string, any> = {
|
|
20
|
-
pLevel:
|
|
23
|
+
pLevel: STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
21
24
|
locale,
|
|
22
25
|
'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
|
|
23
26
|
status: preview ? 'draft' : 'published',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import strapiClient from './strapiClient';
|
|
2
2
|
import {
|
|
3
3
|
STRAPI_DEFAULT_PAGE_SIZE,
|
|
4
|
+
STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
4
5
|
STRAPI_FALLBACK_LOCALE,
|
|
5
6
|
} from '../../constants/strapi';
|
|
6
7
|
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
@@ -25,7 +26,7 @@ const getStrapiCollectionType = async <
|
|
|
25
26
|
const cache = preview ? false : undefined;
|
|
26
27
|
|
|
27
28
|
const sharedParams = {
|
|
28
|
-
pLevel:
|
|
29
|
+
pLevel: STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
29
30
|
'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
|
|
30
31
|
filters,
|
|
31
32
|
status: preview ? 'draft' : 'published',
|
|
@@ -2,6 +2,7 @@ import { AxiosResponse } from 'axios';
|
|
|
2
2
|
import strapiClient from './strapiClient';
|
|
3
3
|
import {
|
|
4
4
|
STRAPI_DEFAULT_PAGE_SIZE,
|
|
5
|
+
STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
5
6
|
STRAPI_FALLBACK_LOCALE,
|
|
6
7
|
} from '../../constants/strapi';
|
|
7
8
|
import IStrapiData from '../../models/strapi/IStrapiData';
|
|
@@ -19,7 +20,7 @@ const getStrapiSingleType = async <T>(
|
|
|
19
20
|
): Promise<IStrapiData<T>> => {
|
|
20
21
|
const cache = preview ? false : undefined;
|
|
21
22
|
const params: Record<string, any> = {
|
|
22
|
-
pLevel:
|
|
23
|
+
pLevel: STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
23
24
|
locale,
|
|
24
25
|
'pagination[pageSize]': STRAPI_DEFAULT_PAGE_SIZE,
|
|
25
26
|
filters,
|
|
@@ -23,7 +23,10 @@ import React, {
|
|
|
23
23
|
import EventCard from '../../components/EventCard';
|
|
24
24
|
import { SWRInfiniteKeyLoader } from 'swr/infinite';
|
|
25
25
|
import useEvents from '../../models/hooks/useEvents';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
STRAPI_DEFAULT_POPULATE_DEPTH,
|
|
28
|
+
STRAPI_URI,
|
|
29
|
+
} from '../../constants/strapi';
|
|
27
30
|
import { IntlContext } from '../../components/ContextProvider';
|
|
28
31
|
import { mutate } from 'swr/_internal';
|
|
29
32
|
import { EventType } from '@testing-library/react';
|
|
@@ -90,7 +93,7 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
90
93
|
url.searchParams.append('pagination[limit]', batchSize.toString());
|
|
91
94
|
url.searchParams.append(startFilter, now);
|
|
92
95
|
url.searchParams.append('locale', locale);
|
|
93
|
-
url.searchParams.append('pLevel',
|
|
96
|
+
url.searchParams.append('pLevel', STRAPI_DEFAULT_POPULATE_DEPTH);
|
|
94
97
|
|
|
95
98
|
if (sort[0] === Sort.OLDEST_FIRST) {
|
|
96
99
|
url.searchParams.append('sort', 'start:asc');
|
|
@@ -165,7 +168,7 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
165
168
|
const fetchAllOptions = useCallback(async () => {
|
|
166
169
|
const url = new URL(`/treely-events`, STRAPI_URI);
|
|
167
170
|
url.searchParams.append('locale', locale);
|
|
168
|
-
url.searchParams.append('pLevel',
|
|
171
|
+
url.searchParams.append('pLevel', STRAPI_DEFAULT_POPULATE_DEPTH);
|
|
169
172
|
|
|
170
173
|
const response = await fetch(
|
|
171
174
|
`${STRAPI_URI}/api/treely-events${url.search}`,
|