diff --git a/src/app/content/hemat-app/master/master-building/master-building.component.ts b/src/app/content/hemat-app/master/master-building/master-building.component.ts index 9f8f1a7..fa9ab21 100644 --- a/src/app/content/hemat-app/master/master-building/master-building.component.ts +++ b/src/app/content/hemat-app/master/master-building/master-building.component.ts @@ -127,8 +127,11 @@ export class MasterBuildingComponent { modalRef.result.then( (result) => { if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { - this.toastr.error("Warning", "Data yang anda masukan double.", { + console.log(result); + console.log(this.filteredRows); + + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status_id === result.statusId)) { + this.toastr.error("Warning", "Nama Gedung yang anda masukan double.", { timeOut: 5000, closeButton: true, }); diff --git a/src/app/content/hemat-app/master/master-category/master-category.component.ts b/src/app/content/hemat-app/master/master-category/master-category.component.ts index 44b8366..d40e9fc 100644 --- a/src/app/content/hemat-app/master/master-category/master-category.component.ts +++ b/src/app/content/hemat-app/master/master-category/master-category.component.ts @@ -153,7 +153,7 @@ export class MasterCategoryComponent implements OnInit { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-duration-use/master-duration-use.component.ts b/src/app/content/hemat-app/master/master-duration-use/master-duration-use.component.ts index 21f20fe..bb87a87 100644 --- a/src/app/content/hemat-app/master/master-duration-use/master-duration-use.component.ts +++ b/src/app/content/hemat-app/master/master-duration-use/master-duration-use.component.ts @@ -135,7 +135,7 @@ export class MasterDurationUseComponent { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-floor/master-floor.component.ts b/src/app/content/hemat-app/master/master-floor/master-floor.component.ts index 7d8dfd4..a9dcc20 100644 --- a/src/app/content/hemat-app/master/master-floor/master-floor.component.ts +++ b/src/app/content/hemat-app/master/master-floor/master-floor.component.ts @@ -135,7 +135,7 @@ export class MasterFloorComponent { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-role/master-role.component.ts b/src/app/content/hemat-app/master/master-role/master-role.component.ts index 7082e07..c9d1214 100644 --- a/src/app/content/hemat-app/master/master-role/master-role.component.ts +++ b/src/app/content/hemat-app/master/master-role/master-role.component.ts @@ -135,7 +135,7 @@ export class MasterRoleComponent { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-status/master-status.component.ts b/src/app/content/hemat-app/master/master-status/master-status.component.ts index e95fe85..fd3caec 100644 --- a/src/app/content/hemat-app/master/master-status/master-status.component.ts +++ b/src/app/content/hemat-app/master/master-status/master-status.component.ts @@ -135,7 +135,7 @@ export class MasterStatusComponent { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-type/master-type.component.ts b/src/app/content/hemat-app/master/master-type/master-type.component.ts index d76de90..b058de3 100644 --- a/src/app/content/hemat-app/master/master-type/master-type.component.ts +++ b/src/app/content/hemat-app/master/master-type/master-type.component.ts @@ -91,7 +91,7 @@ export class MasterTypeComponent { modalRef.result.then( (result) => { if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status)) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true, diff --git a/src/app/content/hemat-app/master/master-voltage/master-voltage.component.ts b/src/app/content/hemat-app/master/master-voltage/master-voltage.component.ts index a821e7a..9711f4a 100644 --- a/src/app/content/hemat-app/master/master-voltage/master-voltage.component.ts +++ b/src/app/content/hemat-app/master/master-voltage/master-voltage.component.ts @@ -126,7 +126,7 @@ export class MasterVoltageComponent { (result) => { console.log(result); if (result) { - if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) { + if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase() && value.status === result.status) ) { this.toastr.error("Warning", "Data yang anda masukan double.", { timeOut: 5000, closeButton: true,