perbaikan profil, update password dan master

This commit is contained in:
2024-07-11 14:39:06 +07:00
parent 28067d1704
commit a9034c1a32
9 changed files with 76 additions and 52 deletions

View File

@@ -91,7 +91,7 @@
let-value="value"
>
<p style="color: #ffffff">
{{ value === "2" ? "Aktif" : "Nonaktif" }}
{{ value }}
</p>
</ng-template>
</ngx-datatable-column>

View File

@@ -91,7 +91,7 @@
let-value="value"
>
<p style="color: #ffffff">
{{ value === "2" ? "Aktif" : "Nonaktif" }}
{{ value }}
</p>
</ng-template>
</ngx-datatable-column>

View File

@@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { Router } from '@angular/router';
import { BuildingService } from '../../service/monitoring-api.service';
import { LoginService } from '../../service/login.service';
import { ToastrService } from 'ngx-toastr';
@Component({
selector: 'app-master-voltage',
@@ -24,7 +25,8 @@ export class MasterVoltageComponent {
private modalService: NgbModal,
private router: Router,
private monitoringApiService: BuildingService,
private authService: LoginService
private authService: LoginService,
private toastr: ToastrService,
) {}
ngOnInit() {
@@ -88,14 +90,20 @@ export class MasterVoltageComponent {
modalRef.componentInstance.mode = "add";
modalRef.result.then(
(result) => {
console.log(result);
if (result) {
this.monitoringApiService
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
this.toastr.error("Warning", "Data yang anda masukan double.", {
timeOut: 5000,
closeButton: true,
});
} else {
this.monitoringApiService
.postHeaderDetailParam(result)
.subscribe((res) => {
console.log(res);
this.fetchData();
});
}
}
},
(reason) => {
@@ -117,14 +125,14 @@ export class MasterVoltageComponent {
modalRef.result.then(
(result) => {
console.log(result);
if (result) {
this.monitoringApiService
.putHeaderDetailParam(result, row.id)
.subscribe((res) => {
console.log(res);
this.fetchData();
});
}
// if (result) {
// this.monitoringApiService
// .putHeaderDetailParam(result, row.id)
// .subscribe((res) => {
// console.log(res);
// this.fetchData();
// });
// }
},
(reason) => {
console.log(`Dismissed: ${reason}`);