Füge Funktion zum Abbrechen der Werbung hinzu: Implementiere cancelWooing in FalukantService und FalukantController, aktualisiere FamilyView für die Benutzeroberfläche und verbessere die Fehlermeldungen bei vorzeitigen Abbrüchen.

This commit is contained in:
Torsten Schulz (local)
2026-01-28 11:53:34 +01:00
parent 16f3d1a320
commit cbff7c130c
8 changed files with 119 additions and 7 deletions

View File

@@ -94,6 +94,16 @@ class FalukantController {
});
this.setHeir = this._wrapWithUser((userId, req) => this.service.setHeir(userId, req.body.childCharacterId));
this.acceptMarriageProposal = this._wrapWithUser((userId, req) => this.service.acceptMarriageProposal(userId, req.body.proposalId));
this.cancelWooing = this._wrapWithUser(async (userId) => {
try {
return await this.service.cancelWooing(userId);
} catch (e) {
if (e && e.name === 'PreconditionError' && e.message === 'cancelTooSoon') {
throw { status: 412, message: 'cancelTooSoon', retryAt: e.meta?.retryAt };
}
throw e;
}
}, { successStatus: 202 });
this.getGifts = this._wrapWithUser((userId) => {
console.log('🔍 getGifts called with userId:', userId);
return this.service.getGifts(userId);