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:
@@ -3225,6 +3225,10 @@ class FalukantService extends BaseService {
|
||||
cost: cost
|
||||
});
|
||||
if (nobilities.length > 0) {
|
||||
// Stelle sicher, dass die Party eine ID hat
|
||||
if (!party.id) {
|
||||
throw new Error('Party wurde erstellt, hat aber keine ID');
|
||||
}
|
||||
// Verwende die bereits geladenen Objekte
|
||||
await party.addInvitedNobilities(nobilities);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user