More webapp changes+fixes
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 1m0s
Build Docker and Deploy / Run Unit-Tests (push) Successful in 9m18s
Build Docker and Deploy / Deploy to Server (push) Successful in 22s

This commit is contained in:
2025-12-07 04:21:11 +01:00
parent 2b7950f5dc
commit c81143ecdc
17 changed files with 297 additions and 20 deletions

View File

@@ -118,6 +118,13 @@ export class SubscriptionDetailComponent implements OnInit {
return sub.channel_owner_user_id === userId;
}
isOwnSubscription(): boolean {
const sub = this.subscription();
if (!sub) return false;
const userId = this.authService.getUserId();
return sub.subscriber_user_id === userId && sub.channel_owner_user_id === userId;
}
getStatusInfo(): { label: string; color: string } {
const sub = this.subscription();
if (!sub) return { label: 'Unknown', color: 'default' };
@@ -153,6 +160,19 @@ export class SubscriptionDetailComponent implements OnInit {
});
}
activateSubscription(): void {
const sub = this.subscription();
const userId = this.authService.getUserId();
if (!sub || !userId) return;
this.apiService.confirmSubscription(userId, sub.subscription_id, { active: true }).subscribe({
next: (updated) => {
this.subscription.set(updated);
this.notification.success('Subscription activated');
}
});
}
deactivateSubscription(): void {
const sub = this.subscription();
const userId = this.authService.getUserId();