perbaikan master edit

This commit is contained in:
Fuzi_fauzia 2024-07-13 22:47:01 +07:00
parent 5b3c9bcba4
commit 5782af4c75
8 changed files with 12 additions and 9 deletions

View File

@ -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,
});

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,