feat: update payment event handling in profile view

Updated the way payment events are handled in the profile view. Now, the first payment event id is retrieved directly from the paymentEvents relationship instead of the payment_event attribute. Also, instead of refreshing the currentPleb model after creating a payment event, it is now loaded with the paymentEvents relationship.
This commit is contained in:
fsociety
2024-09-30 15:51:29 +02:00
parent c47fc8792e
commit 5eb8307691

View File

@@ -62,7 +62,7 @@ on([
}
if ($this->currentPleb->paymentEvents->count() < 1) {
$this->createPaymentEvent();
$this->currentPleb->refresh();
$this->currentPleb->load('paymentEvents');
}
$this->loadEvents();
$this->searchPaymentEvent();
@@ -446,7 +446,7 @@ $loadEvents = function () {
<div
class="font-medium text-gray-800 dark:text-gray-100 mb-1 space-y-2">
<p>Nostr Event für die Zahlung des
Mitgliedsbeitrags: {{ $currentPleb->payment_event }}</p>
Mitgliedsbeitrags: {{ $currentPleb->paymentEvents->first()->event_id }}</p>
<div>
@if(isset($events[0]))
<p>{{ $events[0]['content'] }}</p>