First commit

This commit is contained in:
2026-01-13 21:02:23 -06:00
commit 054f45b5bd
403 changed files with 44137 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, MenuController, NavController, Events } from '@ionic/angular';
import { EnvService } from 'src/app/services/env.service';
import { AuthService } from 'src/app/services/auth.service';
import { IchambaService } from 'src/app/services/ichamba.service';
import { TranslateService } from '@ngx-translate/core';
import { AlertService } from 'src/app/services/alert.service';
@Component({
selector: 'app-cards',
templateUrl: './cards.page.html',
styleUrls: ['./cards.page.scss'],
})
export class CardsPage implements OnInit {
cards = [];
constructor(
private modalController: ModalController,
private menu: MenuController,
private navCtrl: NavController,
private events: Events,
private authService: AuthService,
private alertService: AlertService,
private ichambaService: IchambaService,
private translateService: TranslateService,
private env: EnvService,
) {
this.events.subscribe('refreshcards', (data) => {
this.getcards();
});
}
ngOnInit() {
this.getcards();
}
newcard() {
this.navCtrl.navigateForward('/addcard');
}
getcards() {
this.ichambaService.getCard().subscribe(
data => {
this.cards = data;
}, error => {
this.alertService.presentToast(this.translateService.instant('alerts.error') + error['status']);
});
}
deletecard(id: String) {
this.ichambaService.deleteCard(id).subscribe(
data => {
this.getcards();
this.alertService.presentToast(this.translateService.instant('alerts.deleted_card'));
}, error => {
this.alertService.presentToast(this.translateService.instant('alerts.error') + error['status']);
});
}
}