Refactor association keys in setupAssociations: Update foreign key naming conventions in Party and TitleOfNobility associations for consistency and clarity. Enhance error handling in FalukantService to ensure party ID is present before adding invited nobilities.
This commit is contained in:
@@ -569,14 +569,14 @@ export default function setupAssociations() {
|
||||
|
||||
Party.belongsToMany(TitleOfNobility, {
|
||||
through: PartyInvitedNobility,
|
||||
foreignKey: 'party_id',
|
||||
otherKey: 'title_of_nobility_id',
|
||||
foreignKey: 'partyId',
|
||||
otherKey: 'titleOfNobilityId',
|
||||
as: 'invitedNobilities',
|
||||
});
|
||||
TitleOfNobility.belongsToMany(Party, {
|
||||
through: PartyInvitedNobility,
|
||||
foreignKey: 'title_of_nobility_id',
|
||||
otherKey: 'party_id',
|
||||
foreignKey: 'titleOfNobilityId',
|
||||
otherKey: 'partyId',
|
||||
as: 'partiesInvitedTo',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user