The response to 'getList' must be like { data : [{ id: 123, ...}, ...] }, but the received data items do not have an 'id' key. The dataProvider is probably wrong for 'getList' console.<computed> @ 0.chunk.js:167134
What am I doing wrong?
EDIT: need to include id in serializer fields:
class SaleSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Sale fields = ['id', 'date', ...]
My code is like this: ` import drfProvider from "ra-data-django-rest-framework";
const dataProvider = drfProvider("http://localhost:8000"); `
But, I get this error:
The response to 'getList' must be like { data : [{ id: 123, ...}, ...] }, but the received data items do not have an 'id' key. The dataProvider is probably wrong for 'getList' console.<computed> @ 0.chunk.js:167134
What am I doing wrong?
EDIT: need to include
id
in serializer fields:class SaleSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Sale fields = ['id', 'date', ...]