Expected behavior
I have a table Link which has a ManyToOne relationship avec a table Artist. The primary key of Artist if talentId, so I have link.artistTalentId = artist.talentId.
I want to sort my table Link by artistTalentId.
Actual behavior
What is the current behavior?
When I try to search by artistTalentId in my table Link in ForestAdmin, it adds the parameter ?sort=-artist.id
to my url and I have a log telling me this column does not exists.
How can I configure the sort to use my custom primary key talentId?
This is my configuration in models :
Artists.hasMany(models.streamingLinks, {
foreignKey: {
name: 'artistTalentIdKey',
field: 'artistTalentId',
},
target: {
name: 'talentId',
},
as: 'artistStreamingLinks',
});
StreamingLinks.belongsTo(models.artists, {
foreignKey: {
name: 'artistTalentIdKey',
field: 'artistTalentId',
},
target: {
name: 'talentId',
},
as: 'artist',
});
Thank you very much!