sacred-roseS
Refine12mo ago
10 replies
sacred-rose

How to rename the data index when filtering with FilterDropdown

Here is my code

          <Table.Column<BusinessProfile>
            dataIndex={['business_contract_data', 'business_type']}
            title="Business Type"
            render={(value) => <Tag color={value === 'commercial_business' ? 'blue' : 'orange'}>{value}</Tag>}
            filterDropdown={(props) => (
              <FilterDropdown {...props}>
                <Select
                  mode="multiple"
                  placeholder="Filter Business Type"
                  style={{ width: '150px' }}
                  options={[
                    { label: "Commercial Business", value: ContractBusinessType.COMMERCIAL_BUSINESS },
                    { label: "Freelancer", value: ContractBusinessType.FREELANCER },
                  ]}
                />
              </FilterDropdown>
            )}
          />


Here i am using business_contract_data.business_type as the data index, but I want to filter to send the query params with key business_type only.

how can i rename the query params key?
Was this page helpful?