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:
@@ -457,6 +457,10 @@
|
||||
"wooing": {
|
||||
"gifts": "Werbegeschenke",
|
||||
"sendGift": "Werbegeschenk senden",
|
||||
"cancel": "Werbung abbrechen",
|
||||
"cancelSuccess": "Die Werbung wurde abgebrochen.",
|
||||
"cancelError": "Die Werbung konnte nicht abgebrochen werden.",
|
||||
"cancelTooSoon": "Du kannst die Werbung erst nach 24 Stunden abbrechen.",
|
||||
"gift": "Geschenk",
|
||||
"value": "Kosten",
|
||||
"effect": "Wirkung"
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
"datetimelong": "dd.MM.yyyy HH:mm:ss",
|
||||
"loading": "Lädt...",
|
||||
"back": "Zurück",
|
||||
"cancel": "Abbrechen"
|
||||
"cancel": "Abbrechen",
|
||||
"yes": "Ja",
|
||||
"no": "Nein"
|
||||
},
|
||||
"OK": "Ok",
|
||||
"Cancel": "Abbrechen",
|
||||
|
||||
@@ -303,6 +303,24 @@
|
||||
"taxPercent": "Tax %"
|
||||
}
|
||||
}
|
||||
},
|
||||
"spouse": {
|
||||
"wooing": {
|
||||
"cancel": "Cancel wooing",
|
||||
"cancelSuccess": "Wooing has been cancelled.",
|
||||
"cancelError": "Wooing could not be cancelled.",
|
||||
"cancelTooSoon": "You can only cancel wooing after 24 hours."
|
||||
}
|
||||
},
|
||||
"sendgift": {
|
||||
"error": {
|
||||
"nogiftselected": "Please select a gift.",
|
||||
"generic": "An unknown error occurred.",
|
||||
"tooOften": "You can't send gifts that often.",
|
||||
"insufficientFunds": "You do not have enough money."
|
||||
},
|
||||
"success": "The gift has been given.",
|
||||
"nextGiftAt": "Next gift from"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,52 @@
|
||||
{
|
||||
"welcome": "Welcome to YourPart",
|
||||
"imprint": {
|
||||
"title": "Imprint"
|
||||
"title": "Imprint",
|
||||
"button": "Imprint"
|
||||
},
|
||||
"dataPrivacy": {
|
||||
"title": "Data Privacy Policy"
|
||||
"title": "Data Privacy Policy",
|
||||
"button": "Data Privacy Policy"
|
||||
},
|
||||
"contact": {
|
||||
"title": "Contact",
|
||||
"button": "Contact"
|
||||
},
|
||||
"error-title": "Error",
|
||||
"warning-title": "Warning",
|
||||
"info-title": "Information",
|
||||
"general": {
|
||||
"loading": "Loading...",
|
||||
"back": "Back",
|
||||
"cancel": "Cancel",
|
||||
"datetimelong": "dd.MM.yyyy HH:mm:ss"
|
||||
"datetimelong": "dd.MM.yyyy HH:mm:ss",
|
||||
"yes": "Yes",
|
||||
"no": "No"
|
||||
},
|
||||
"OK": "Ok",
|
||||
"Cancel": "Cancel",
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"message": {
|
||||
"close": "Close"
|
||||
},
|
||||
"dialog": {
|
||||
"contact": {
|
||||
"email": "Email address",
|
||||
"name": "Name",
|
||||
"message": "Your message to us",
|
||||
"accept": "Your email address will be temporarily stored in our system. After your request has been processed, the email address will be deleted again.",
|
||||
"acceptdatasave": "I agree to the temporary storage of my email address.",
|
||||
"accept2": "Without this consent we unfortunately cannot reply to you."
|
||||
}
|
||||
},
|
||||
"gender": {
|
||||
"male": "Male",
|
||||
"female": "Female",
|
||||
"transmale": "Trans man",
|
||||
"transfemale": "Trans woman",
|
||||
"nonbinary": "Non-binary"
|
||||
},
|
||||
"common": {
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
|
||||
@@ -82,9 +82,9 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<button @click="sendGift" class="button">{{ $t('falukant.family.spouse.wooing.sendGift')
|
||||
}}</button>
|
||||
<div class="wooing-actions">
|
||||
<button @click="sendGift" class="button">{{ $t('falukant.family.spouse.wooing.sendGift') }}</button>
|
||||
<button @click="cancelWooing" class="button button-secondary">{{ $t('falukant.family.spouse.wooing.cancel') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -341,6 +341,24 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async cancelWooing() {
|
||||
try {
|
||||
await apiClient.post('/api/falukant/family/cancel-wooing');
|
||||
await this.loadFamilyData();
|
||||
this.$root.$refs.messageDialog?.open('tr:falukant.family.spouse.wooing.cancelSuccess');
|
||||
} catch (error) {
|
||||
console.error('Error cancelling wooing:', error);
|
||||
if (error?.response?.status === 412) {
|
||||
const retryAtIso = error.response?.data?.retryAt;
|
||||
const retryStr = retryAtIso ? new Date(retryAtIso).toLocaleString(navigator.language, { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }) : '';
|
||||
const msg = this.$t('falukant.family.spouse.wooing.cancelTooSoon');
|
||||
this.$root.$refs.errorDialog?.open(retryStr ? `${msg} — ${this.$t('falukant.family.sendgift.nextGiftAt')}: ${retryStr}` : msg);
|
||||
} else {
|
||||
this.$root.$refs.errorDialog?.open('tr:falukant.family.spouse.wooing.cancelError');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async sendGift() {
|
||||
if (!this.selectedGiftId) {
|
||||
this.$root.$refs.errorDialog.open(`tr:falukant.family.sendgift.error.nogiftselected`);
|
||||
|
||||
Reference in New Issue
Block a user