perbaikan master edit
This commit is contained in:
parent
5b3c9bcba4
commit
5782af4c75
|
@ -127,8 +127,11 @@ export class MasterBuildingComponent {
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
if (this.filteredRows.some(value => value.name.toLowerCase() === result.name.toLowerCase())) {
|
console.log(result);
|
||||||
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
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,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -153,7 +153,7 @@ export class MasterCategoryComponent implements OnInit {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class MasterDurationUseComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class MasterFloorComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class MasterRoleComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class MasterStatusComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class MasterTypeComponent {
|
||||||
modalRef.result.then(
|
modalRef.result.then(
|
||||||
(result) => {
|
(result) => {
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
|
@ -126,7 +126,7 @@ export class MasterVoltageComponent {
|
||||||
(result) => {
|
(result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (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.", {
|
this.toastr.error("Warning", "Data yang anda masukan double.", {
|
||||||
timeOut: 5000,
|
timeOut: 5000,
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|
Loading…
Reference in New Issue