mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +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 React, { memo, useMemo } from 'react';
 | 
			
		||||
import { useIntl } from 'react-intl';
 | 
			
		||||
@ -18,6 +19,7 @@ import { connect, select, normalizeSearchResults, diffRelations, normalizeRelati
 | 
			
		||||
export const RelationInputDataManager = ({
 | 
			
		||||
  error,
 | 
			
		||||
  componentId,
 | 
			
		||||
  componentUid,
 | 
			
		||||
  editable,
 | 
			
		||||
  description,
 | 
			
		||||
  intlLabel,
 | 
			
		||||
@ -64,7 +66,14 @@ export const RelationInputDataManager = ({
 | 
			
		||||
      endpoint: endpoints.search,
 | 
			
		||||
      pageParams: {
 | 
			
		||||
        ...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,
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -82,6 +82,7 @@ function useSelect({
 | 
			
		||||
 | 
			
		||||
  return {
 | 
			
		||||
    componentId,
 | 
			
		||||
    componentUid,
 | 
			
		||||
    queryInfos: {
 | 
			
		||||
      ...queryInfos,
 | 
			
		||||
      endpoints: {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user