mirror of
https://github.com/strapi/strapi.git
synced 2025-08-02 05:48:39 +00:00
hotfix: entityId chaos
This commit is contained in:
parent
55c20e9773
commit
13cf08a5b4
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-nested-ternary */
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { memo, useMemo } from 'react';
|
import React, { memo, useMemo } from 'react';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
@ -18,6 +19,7 @@ import { connect, select, normalizeSearchResults, diffRelations, normalizeRelati
|
|||||||
export const RelationInputDataManager = ({
|
export const RelationInputDataManager = ({
|
||||||
error,
|
error,
|
||||||
componentId,
|
componentId,
|
||||||
|
componentUid,
|
||||||
editable,
|
editable,
|
||||||
description,
|
description,
|
||||||
intlLabel,
|
intlLabel,
|
||||||
@ -64,7 +66,14 @@ export const RelationInputDataManager = ({
|
|||||||
endpoint: endpoints.search,
|
endpoint: endpoints.search,
|
||||||
pageParams: {
|
pageParams: {
|
||||||
...defaultParams,
|
...defaultParams,
|
||||||
entityId: isCreatingEntry ? undefined : componentId ?? initialData.id,
|
// TODO: fix me cause this sucks
|
||||||
|
entityId: isCreatingEntry
|
||||||
|
? undefined
|
||||||
|
: componentUid && !componentId
|
||||||
|
? undefined
|
||||||
|
: !componentUid && !componentId
|
||||||
|
? initialData.id
|
||||||
|
: componentId,
|
||||||
pageSize: SEARCH_RESULTS_TO_DISPLAY,
|
pageSize: SEARCH_RESULTS_TO_DISPLAY,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -82,6 +82,7 @@ function useSelect({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
componentId,
|
componentId,
|
||||||
|
componentUid,
|
||||||
queryInfos: {
|
queryInfos: {
|
||||||
...queryInfos,
|
...queryInfos,
|
||||||
endpoints: {
|
endpoints: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user