0

I had to change in the restclient after like this:

        var parentresource = '';
        switch (resource) {
            case 'details':
                parentresource = `products/${params.id}/${resource}`;
                break;
            default:
                parentresource = `${resource}`;
        }**

        url = `${apiUrl}/${**parentresource**}?${fetchUtils.queryParameters(query)}`;
        break;

I have a EditView where in one tab I have got:

<ReferenceManyField addLabel={false} reference="details" target="id">
                    <Datagrid>
                        <NumberField source="quantity" label="Quantity" />
                        <TextField source="measurementUnit" label="Measurement" />
                        <NumberField source="purchasePrice" label="Purchase Price" />
                        <NumberField source="salesPrice" label="Sales Price" />
                        <NumberField source="discountPercent" label="Discount Percent" />
                        <NumberField source="salesTaxPercent" label="Sales Tax Percent" />                        
                        <TextField source="supplier" label="Supplier" />
                        <DateField source="createdDate" label="Created Date" />
                        <TextField source="status" label="Status" /> 
                        <EditButton basePath="/products" />
                    </Datagrid>
                </ReferenceManyField>

When I click EditButton the url in the browser needs to needs to be http://localhost:5000/#/details/1?_k=5f7qc1 but the url to grab data from should be http://localhost:5000/api/products/2/details/1

Any easier way to do this?

Panna Ahmed
  • 11
  • 1
  • 4

1 Answers1

0

That's the job of a custom restclient

Gildas Garcia
  • 6,966
  • 3
  • 15
  • 29